Weird HTTP header issue with PresentationServer 3.0 beta 2

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird HTTP header issue with PresentationServer 3.0 beta 2

Eric van der Vlist
Hi,

I have a weird issue with HTTP headers using PresentationServer 3.0 beta
2,

I have uncommented the choose block that allows sending XHTML as
application/xhtml+xml to clients that accept this media type in
epilogue-servlet.xpl and, spuriously, a

Content-Type: application/octet-stream;charset=utf-8

header instead of the expected

Content-Type: application/xhtml+xml;charset=utf-8

This error seems more or less spurious and I have to reload several
times the same page, playing with reload and shift reload before it
happens.

Note that when I add a debug attribute in the input of the HTTP
serialization:

<p:input name="data" href="#converted" debug="true"/>

this weirdness disappears the header is always correct (I had to use
tcpflow to trace it).

Since this attribute disables caching, it is thus possible that this
issue is related to the caching mechanism.

Thanks,

Eric

--
Don't you think all these XML schema languages should work together?
                                                         http://dsdl.org
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Erik Bruchez
Administrator
Eric,

If you put a debug attribute on the input of the HTTP serializer, what
content-type attribute do you see there?

You should be able to force the content-type by using:

<content-type>application/xhtml+xml</content-type>
<force-content-type>true</force-content-type>

On either the converter or the serializer. Still, I don't notice this
behavior here: I get the application/xhtml+xml content-type out.

-Erik

Eric van der Vlist wrote:

> Hi,
>
> I have a weird issue with HTTP headers using PresentationServer 3.0 beta
> 2,
>
> I have uncommented the choose block that allows sending XHTML as
> application/xhtml+xml to clients that accept this media type in
> epilogue-servlet.xpl and, spuriously, a
>
> Content-Type: application/octet-stream;charset=utf-8
>
> header instead of the expected
>
> Content-Type: application/xhtml+xml;charset=utf-8
>
> This error seems more or less spurious and I have to reload several
> times the same page, playing with reload and shift reload before it
> happens.
>
> Note that when I add a debug attribute in the input of the HTTP
> serialization:
>
> <p:input name="data" href="#converted" debug="true"/>
>
> this weirdness disappears the header is always correct (I had to use
> tcpflow to trace it).
>
> Since this attribute disables caching, it is thus possible that this
> issue is related to the caching mechanism.
>
> Thanks,
>
> Eric


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Eric van der Vlist
Hi Erik,

On jeu, 2005-09-01 at 13:26 -0700, Erik Bruchez wrote:
> Eric,
>
> If you put a debug attribute on the input of the HTTP serializer, what
> content-type attribute do you see there?

The one that I am expecting, but as mentioned, adding this debug
attributes fixes the problem!

> You should be able to force the content-type by using:
>
> <content-type>application/xhtml+xml</content-type>
> <force-content-type>true</force-content-type>
>
> On either the converter or the serializer. Still, I don't notice this
> behavior here: I get the application/xhtml+xml content-type out.

Even when you remove the debug attribute?

I can send you my full application if that helps.

Thanks,

Eric

--
Weblog:
                 http://eric.van-der-vlist.com/blog?t=category&a=English
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Erik Bruchez
Administrator
In reply to this post by Eric van der Vlist
Eric van der Vlist wrote:

> Note that when I add a debug attribute in the input of the HTTP
> serialization:
>
> <p:input name="data" href="#converted" debug="true"/>
>
> this weirdness disappears the header is always correct (I had to use
> tcpflow to trace it).
>
> Since this attribute disables caching, it is thus possible that this
> issue is related to the caching mechanism.
I didn't get this part of your message in the first reply.

Yes, that's possible. However, in both cases (XHTML and HTML), there is
a very similar path: oxf:qname-converter, then oxf:???-converter. The
bug, if any, should be there in the HTML case as well!

-Erik



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Eric van der Vlist
On jeu, 2005-09-01 at 13:35 -0700, Erik Bruchez wrote:

> Eric van der Vlist wrote:
>
> > Note that when I add a debug attribute in the input of the HTTP
> > serialization:
> >
> > <p:input name="data" href="#converted" debug="true"/>
> >
> > this weirdness disappears the header is always correct (I had to use
> > tcpflow to trace it).
> >
> > Since this attribute disables caching, it is thus possible that this
> > issue is related to the caching mechanism.
>
> I didn't get this part of your message in the first reply.
>
> Yes, that's possible. However, in both cases (XHTML and HTML), there is
> a very similar path: oxf:qname-converter, then oxf:???-converter. The
> bug, if any, should be there in the HTML case as well!
Yes, I can confirm that it happens also in the HTML case.

That's less spurious than I had thought and to reproduce it, I just need
to press "shift+reload" twice after having removed the debug attribute
on the http-serializer input:

            <p:processor name="oxf:http-serializer">
                <p:input name="config">
                    <config>
                        <header>
                            <name>Cache-Control</name>
                            <value>post-check=0, pre-check=0</value>
                        </header>
                    </config>
                </p:input>
                <p:input name="data" href="#converted" debug="converted"/>
            </p:processor>

Eric

--
Weblog:
                 http://eric.van-der-vlist.com/blog?t=category&a=English
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Erik Bruchez
Administrator
Eric van der Vlist wrote:

> On jeu, 2005-09-01 at 13:35 -0700, Erik Bruchez wrote:
>
>>Eric van der Vlist wrote:
>>
>>
>>>Note that when I add a debug attribute in the input of the HTTP
>>>serialization:
>>>
>>><p:input name="data" href="#converted" debug="true"/>
>>>
>>>this weirdness disappears the header is always correct (I had to use
>>>tcpflow to trace it).
>>>
>>>Since this attribute disables caching, it is thus possible that this
>>>issue is related to the caching mechanism.
>>
>>I didn't get this part of your message in the first reply.
>>
>>Yes, that's possible. However, in both cases (XHTML and HTML), there is
>>a very similar path: oxf:qname-converter, then oxf:???-converter. The
>>bug, if any, should be there in the HTML case as well!
>
>
> Yes, I can confirm that it happens also in the HTML case.
>
> That's less spurious than I had thought and to reproduce it, I just need
> to press "shift+reload" twice after having removed the debug attribute
> on the http-serializer input:
>
>             <p:processor name="oxf:http-serializer">
>                 <p:input name="config">
>                     <config>
>                         <header>
>                             <name>Cache-Control</name>
>                             <value>post-check=0, pre-check=0</value>
>                         </header>
>                     </config>
>                 </p:input>
>                 <p:input name="data" href="#converted" debug="converted"/>
>             </p:processor>
It would be great if you had a simple reproduceable case. I can't see
this right now. What servlet engine are you using?

-Erik



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Erik Bruchez
Administrator
Erik Bruchez wrote:

> It would be great if you had a simple reproduceable case. I can't see
> this right now. What servlet engine are you using?

Eric,

I got the case by private email, thanks.

I managed to reproduce it. That's a good catch! The reason this is
happening is that you can optionally configure the serializer to use a
local cache. In fact, this is the default setting. What this does is
cause the serializer to store its output to the cache if possible.

However, when replaying the data from the cache, no header information
is set - hence the bug.

We won't be able to fix this before our vacation, but it shouldn't be
too hard to fix so I hope the fix can make it into 3.0 final.

The bug entry:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=304021&group_id=168&atid=350207

Often data generated by OPS is not static enough to be entirely cached
at the serializer level, which explains why people don't hit this too often.

-Erik



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Erik Bruchez
Administrator
Erik Bruchez wrote:

> I managed to reproduce it. That's a good catch! The reason this is
> happening is that you can optionally configure the serializer to use a
> local cache. In fact, this is the default setting. What this does is
> cause the serializer to store its output to the cache if possible.

Forgot to say that you can disable this by setting:

<config>
   ...
   <cache-control>
     <use-local-cache>false</use-local-cache>
   </cache-control>
</config>

in the serialize configuration.

-Erik



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Eric van der Vlist
In reply to this post by Erik Bruchez
On ven, 2005-09-02 at 18:07 -0700, Erik Bruchez wrote:

> Erik Bruchez wrote:
>
> > It would be great if you had a simple reproduceable case. I can't see
> > this right now. What servlet engine are you using?
>
> Eric,
>
> I got the case by private email, thanks.
>
> I managed to reproduce it. That's a good catch! The reason this is
> happening is that you can optionally configure the serializer to use a
> local cache. In fact, this is the default setting. What this does is
> cause the serializer to store its output to the cache if possible.
>
> However, when replaying the data from the cache, no header information
> is set - hence the bug.
>
> We won't be able to fix this before our vacation, but it shouldn't be
> too hard to fix so I hope the fix can make it into 3.0 final.
No problem, I can live without cache in the meantime.

Thanks and enjoy your vacation!

Eric
--
Curious about Relax NG? Read my book online.
                                   http://books.xmlschemata.org/relaxng/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Eric van der Vlist
In reply to this post by Erik Bruchez
On ven, 2005-09-02 at 18:18 -0700, Erik Bruchez wrote:

> Erik Bruchez wrote:
>
> > I managed to reproduce it. That's a good catch! The reason this is
> > happening is that you can optionally configure the serializer to use a
> > local cache. In fact, this is the default setting. What this does is
> > cause the serializer to store its output to the cache if possible.
>
> Forgot to say that you can disable this by setting:
>
> <config>
>    ...
>    <cache-control>
>      <use-local-cache>false</use-local-cache>
>    </cache-control>
> </config>
>
> in the serialize configuration.
And the debug attribute happens to have the same effect... that's what I
was suspecting, thanks for the tip!

Eric

--
Have you ever thought about unit testing XSLT templates?
                                                     http://xsltunit.org
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Weird HTTP header issue with PresentationServer 3.0 beta 2

Erik Bruchez
Administrator
In reply to this post by Eric van der Vlist
Eric van der Vlist wrote:

> On ven, 2005-09-02 at 18:07 -0700, Erik Bruchez wrote:
>> Erik Bruchez wrote:
>>
>>> It would be great if you had a simple reproduceable case. I can't see
>>> this right now. What servlet engine are you using?
>> Eric,
>>
>> I got the case by private email, thanks.
>>
>> I managed to reproduce it. That's a good catch! The reason this is
>> happening is that you can optionally configure the serializer to use a
>> local cache. In fact, this is the default setting. What this does is
>> cause the serializer to store its output to the cache if possible.
>>
>> However, when replaying the data from the cache, no header information
>> is set - hence the bug.
>>
>> We won't be able to fix this before our vacation, but it shouldn't be
>> too hard to fix so I hope the fix can make it into 3.0 final.
>
> No problem, I can live without cache in the meantime.
>
> Thanks and enjoy your vacation!
This bug is now fixed!

-Erik




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws