You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Werner Punz <we...@gmail.com> on 2010/12/10 10:19:00 UTC

MyFaces and GAE weird behavior

Hello, I just wanted to discuss some weird behavior I am facing with GAE 
in conjunction with MyFaces I assume this is GAE related but I just 
wonder if we can fix or work around it on our side.

Here is the situation:

Given that I want to help a user out regarding all this,
I have a testing project deployed with MyFaces 2.0 on GAE, for now the 
state saving is server (not tested yet on client)
GAE supports session handling on its infrastructure with memcache, but 
here is the problem. I have  a basic keepalive enabled which should 
refresh the memcache session and keep it alive. This works, but 
occasionally GAE seems to hickup and delivers a null object on the code 
which we use to access our serialised view, which results in a ViewRoot 
not found exception. Now this is definitely a GAE problem, but I wonder 
if we cannot fix it up on our side, maybe by triggering some API from 
google.

Here is the example
http://testinck4040.appspot.com/welcome.jsf

You can leave the browser runnning, especially in the beginning, you 
will see this hickup from time to time, as soon as you confirm the error 
alert the next ajax request again goes through because the subsequent 
request was again able to restore the viewroot.
After a while the errors become less or go away, which looks eerily like 
caching behavior to me.


I assume this has something to do with GAEs internal way of serialising 
the session from time to time.
Either way, any ideas or insight on this?


Werner


Re: MyFaces and GAE weird behavior

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

I have read all evidence until now and I think it is clear what's going on.
I checked if the state could be serialized and it works, so my first theory
was discarded.

At this point, the following facts are true:

1. If encryption is disabled, the problem dissapear.
2. If encryption is enabled and no org.apache.myfaces.SECRET and
org.apache.myfaces.MAC_SECRET are set the problem is present.
3. If encryption is enabled and only org.apache.myfaces.SECRET is set the
problem is present.
4. If encryption is enabled and org.apache.myfaces.SECRET and
org.apache.myfaces.MAC_SECRET are set the problem dissapear.

By default if no secret or mac secret is set MyFaces generate automatically
one at startup. This works well when we have only one server running (that's
the reason why we don't see it standalone), but does not work well when the
application runs into a cluster like with GAE.

Let's suppose we have two server, A and B. At start myfaces is initialized
on server A and the session is generated. After some time the session is
serialized to disk, and on a further request, serve B should handle the
request. In that case, B should call initialization code and here is where
the problem begins, during initialization another secret is generated
without take into account the one in A. Later, since the secrets does not
match, an ViewExpiredException is thrown, because it can't decode correctly
with the key it was generated.

The reason why both org.apache.myfaces.SECRET and
org.apache.myfaces.MAC_SECRET should be set, is because we need to ensure
the same secret is used on every request. Since we define the key on
web.xml, a random one is no longer used and the problem dissapear.

One possible option to make this one more user friendly is save the random
org.apache.myfaces.SECRET and org.apache.myfaces.MAC_SECRET on session map,
so when the session is restored, the right secret is always used. Note this
is an enhancement, so the current behavior is valid.

The problem with ajax seems to be by some reason the session is marked as
invalid, so the full response is sent, but it is not clear why it happens.

regards,

Leonardo Uribe

Re: MyFaces and GAE weird behavior

Posted by Werner Punz <we...@gmail.com>.
Yeah it seems like it, never had this issue here though, strangely.
The request seems to be absolutely correct and should be identified as 
ajax request.

Werner


Am 13.12.10 21:12, schrieb Ganesh:
> Sure! I always have this request:
>
> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>
>
> and 1500 time I this response:
>
> <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update
> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>
>
> Then, suddenly I get this one:
>
> <?xml version='1.0' encoding='UTF-8' ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
> <html xmlns="http://www.w3.org/1999/xhtml"><head>
> <title>Facelet Title</title><script type="text/javascript"
> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>
>
> //--></script></head><body><form id="j_id1631913672_61450686"
> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
> enctype="application/x-www-form-urlencoded">
> Selector
> <script type="text/javascript"><!--
>
> setInterval(function() {
> jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu",
> render:"@none"});
> }, 100);
> //--></script><select id="menu" name="menu" size="1"
> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
> register','javax.faces.behavior.event':'change'})"> <option
> value="1">one</option> <option value="2"
> selected="selected">two</option></select><select id="menu2" name="menu2"
> size="1"
> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
> <option value="1">one</option> <option value="2"
> selected="selected">two</option></select><span id="register">2</span>
> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
> value="1" /><input type="hidden" name="javax.faces.ViewState"
> id="javax.faces.ViewState"
> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
> /></form>
> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
> id="javax_faces_developmentstage_messages"></div></body>
> </html>
>
> Some system component gets an hickup after a while ... let me do some
> additional tests before I submit an issue. Did you try reducing the
> intervall to 100 and let glassfish run for an hour? On Tomcat this can
> definitely be reproduced!
>
> Best regards,
> Ganesh
>
> Am 13.12.2010 18:28, schrieb Werner Punz:
>> Hi I never had a full response in my testing case.
>> Not sure how you triggered it in my code as well.
>>
>> Either way a full response points towards that the server was not
>> interpreting the ajax request as ajax request, which is close to
>> impossible in the standard jsf2 ajax part because the ajax markers are
>> appended at ever request automatically in the code no matter what.
>> Can you show me what request is sent downwards which caused the full
>> response instead of the ajax one?
>>
>>
>> Werner
>>
>>
>> Am 13.12.10 18:18, schrieb Ganesh:
>>> I had already taken crypto out - running with clean standard
>>> configuration, but I'm probably producing a bug different from yours:
>>> Once in a while I'm getting a complete HTML response on an XHR request.
>>>
>>> I'll do some more testing and then open a new bug.
>>>
>>> Best regards,
>>> Ganesh
>>>
>>> Request:
>>> menu=1&menu2=1&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=F8vqQJXUrd4zAZMzy8pO6QpsR0MoQCS001fI%2BaRelCM3BwX5gVhP1F1HbOnrY7di%2BaEzD2dOBzMwrfsplPJBRSeUcyZ%2BBmw6pwlX7DigjiMx9A2oOe7ztPJtY5c%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>
>>>
>>>
>>> Response:
>>> <?xml version='1.0' encoding='UTF-8' ?>
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>>> <html xmlns="http://www.w3.org/1999/xhtml"
>>> xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"><head>
>>> <title>Facelet Title</title><script type="text/javascript"
>>> src="/TestGAE/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>>
>>>
>>>
>>> //--></script></head><body><form id="j_id1631913672_61450686"
>>> name="j_id1631913672_61450686" method="post"
>>> action="/TestGAE/welcome.jsf"
>>> enctype="application/x-www-form-urlencoded">
>>> Selector
>>> <script type="text/javascript"><!--
>>>
>>> setInterval(function() {
>>> jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu",
>>> render:"@none"});
>>> }, 100);
>>> //--></script><select id="menu" name="menu" size="1"
>>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>>> register','javax.faces.behavior.event':'change'})"> <option value="1"
>>> selected="selected">one</option> <option
>>> value="2">two</option></select><select id="menu2" name="menu2" size="1"
>>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>>>
>>> <option value="1" selected="selected">one</option> <option
>>> value="2">two</option></select><span id="register">1</span>
>>> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
>>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>>> id="javax.faces.ViewState"
>>> value="F8vqQJXUrd4zAZMzy8pO6QpsR0MoQCS001fI+aRelCM3BwX5gVhP1F1HbOnrY7diEoaJsT2FQu0wrfsplPJBRSeUcyZ+Bmw6l4QOe8gddH2qxjx8SrlrzKy8qxU="
>>>
>>> /></form>
>>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>>> id="javax_faces_developmentstage_messages"></div></body>
>>> </html>
>>>
>>>
>>>
>>> Am 13.12.2010 16:39, schrieb Werner Punz:
>>>> Hi Ganesh take out the encryption entry in the web.xml. For me all
>>>> bugs are gone on the defaults.
>>>> Or even better turn encryption off entirely in the web.xml by setting
>>>> it explicitely on off.
>>>> I already raised a bug but since the original bug was caused by a
>>>> fault entry in the web.xml on my side and since it is gone entirely
>>>> afterwards I closed it again.
>>>>
>>>>
>>>> Werner
>>>>
>>>>
>>>> Am 13.12.10 12:38, schrieb Ganesh:
>>>>> Reproduced on Tomcat (had to remove your ezcomp as it uses JEE6
>>>>> syntax).
>>>>> Took several thousand requests to happen (increased firepower by
>>>>> decreasing intervall to 100ms). Bug: MyFaces 2.0.2 sometimes answers
>>>>> AJAX Request with a full HTML page.
>>>>>
>>>>> Best regards,
>>>>> Ganesh
>>>>>
>>>>> Am 12.12.2010 15:50, schrieb Werner Punz:
>>>>>> Ok I can reproduce the issue locally on glassfish as well by leaving
>>>>>> my application running and triggering the ajax requests locally.
>>>>>> (Currently testing against glassfish)
>>>>>> So GAE is out of the game now. I guess we have a serious bug here,
>>>>>> not
>>>>>> sure if it is crypto related, I just removed all the keys, to have
>>>>>> the
>>>>>> app running at defaults. The next step now is to disable crypto
>>>>>> entirely. Either way I guess it is time to file a bugreport, this is
>>>>>> definitely not GAE anymore.
>>>>>>
>>>>>> Werner
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 12.12.10 12:08, schrieb Werner Punz:
>>>>>>> Ok I have to revert my last mail, I just got the error again despite
>>>>>>> having no encryption at all.
>>>>>>>
>>>>>>> Werner
>>>>>>>
>>>>>>>
>>>>>>> Am 12.12.10 12:05, schrieb Werner Punz:
>>>>>>>> Hi the issue seems to be encrypten related, my mistake I set a
>>>>>>>> secret
>>>>>>>> and no secret_mac as leo suggested.
>>>>>>>> I now removed testwise the encryption entirely and the problem
>>>>>>>> seems to
>>>>>>>> be gone even for server side state saving.
>>>>>>>>
>>>>>>>> GAE has improved their session handling, I am still running on
>>>>>>>> server
>>>>>>>> side settings with no impact so far, so I do think the general
>>>>>>>> recommendation of having to use client side state saving can be
>>>>>>>> reverted
>>>>>>>> to some degree (there are size limitations for server sessions
>>>>>>>> afaik)
>>>>>>>>
>>>>>>>> Werber
>>>>>>>>
>>>>>>>>
>>>>>>>> Am 11.12.10 05:15, schrieb Ganesh:
>>>>>>>>> Wow, you've invented the AJAX LOIC!
>>>>>>>>>
>>>>>>>>> After running it a minute with Firebug ON it gives me a different
>>>>>>>>> error
>>>>>>>>> than you described:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> First I get about 10-50 successfull AJAX requests (I let it run
>>>>>>>>> autonomously, no AJAX request manually triggerd):
>>>>>>>>>
>>>>>>>>> REQUEST
>>>>>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> RESPONSE
>>>>>>>>> <?xml version="1.0"
>>>>>>>>> encoding="utf-8"?><partial-response><changes><update
>>>>>>>>> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Then I get 2 requests where MyFaces suddenly answers the AJAX
>>>>>>>>> requests
>>>>>>>>> with HTML:
>>>>>>>>>
>>>>>>>>> REQUEST
>>>>>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> RESPONSE
>>>>>>>>> <?xml version='1.0' encoding='UTF-8' ?>
>>>>>>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>>>>>>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>>>>>>>>> <html xmlns="http://www.w3.org/1999/xhtml"><head>
>>>>>>>>> <title>Facelet Title</title><script type="text/javascript"
>>>>>>>>> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> //--></script></head><body><form id="j_id1631913672_61450686"
>>>>>>>>> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
>>>>>>>>> enctype="application/x-www-form-urlencoded">
>>>>>>>>> Selector
>>>>>>>>> <script type="text/javascript"><!--
>>>>>>>>>
>>>>>>>>> setInterval(function() {
>>>>>>>>> jsf.ajax.request(document.getElementById("menu"),null,
>>>>>>>>> {execute:"menu",
>>>>>>>>> render:"@none"});
>>>>>>>>> }, 10000);
>>>>>>>>> //--></script><select id="menu" name="menu" size="1"
>>>>>>>>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> register','javax.faces.behavior.event':'change'})"> <option
>>>>>>>>> value="1">one</option> <option value="2"
>>>>>>>>> selected="selected">two</option></select><select id="menu2"
>>>>>>>>> name="menu2"
>>>>>>>>> size="1"
>>>>>>>>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <option value="1">one</option> <option value="2"
>>>>>>>>> selected="selected">two</option></select><span
>>>>>>>>> id="register">2</span>
>>>>>>>>> updatearea<input type="hidden"
>>>>>>>>> name="j_id1631913672_61450686_SUBMIT"
>>>>>>>>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>>>>>>>>> id="javax.faces.ViewState"
>>>>>>>>> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> /></form>
>>>>>>>>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>>>>>>>>> id="javax_faces_developmentstage_messages"></div></body>
>>>>>>>>> </html>
>>>>>>>>>
>>>>>>>>> And after exactly two HTML responses the AJAX LOIC stops.
>>>>>>>>>
>>>>>>>>> Can you confirm this behaviour from your tests? I think I've seen
>>>>>>>>> this
>>>>>>>>> behaviour when developing the DojoFaces showroom on Tomcat, so
>>>>>>>>> maybe
>>>>>>>>> it's not GAE specific. I planned to investigate into this since
>>>>>>>>> long.
>>>>>>>>> Can you please send the LOIC source? I'll direct it on Tomcat and
>>>>>>>>> report, whether I can reproduce the behaviour there.
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>> Ganesh
>>>>>>>>>
>>>>>>>>> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>>>>>>>>>> Hi
>>>>>>>>>>
>>>>>>>>>> I readed your previous emails related to this one and one
>>>>>>>>>> possibility
>>>>>>>>>> that comes to my mind is we are storing something on session
>>>>>>>>>> without
>>>>>>>>>> implement Serializable interface. If that so, as soon as GAE
>>>>>>>>>> serialize
>>>>>>>>>> the session to disk, that code causes an Exception and when
>>>>>>>>>> MyFaces
>>>>>>>>>> try to restore the state it just has dissapeared (servlet
>>>>>>>>>> session is
>>>>>>>>>> invalid, so a new one is created and our value in
>>>>>>>>>> javax.faces.ViewState request parameter is not found, so a
>>>>>>>>>> ViewExpiredException is thrown).
>>>>>>>>>>
>>>>>>>>>> The solution if that is the case is check all lines that do
>>>>>>>>>> something
>>>>>>>>>> with session map and check if it is possible to serialize to
>>>>>>>>>> disk. I
>>>>>>>>>> tried the demo but I don't see the exception.
>>>>>>>>>>
>>>>>>>>>> regards,
>>>>>>>>>>
>>>>>>>>>> Leonardo Uribe
>>>>>>>>>>
>>>>>>>>>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>>>>>>>>>> <ma...@gmail.com>>
>>>>>>>>>>
>>>>>>>>>> Hello, I just wanted to discuss some weird behavior I am facing
>>>>>>>>>> with
>>>>>>>>>> GAE in conjunction with MyFaces I assume this is GAE related
>>>>>>>>>> but I
>>>>>>>>>> just wonder if we can fix or work around it on our side.
>>>>>>>>>>
>>>>>>>>>> Here is the situation:
>>>>>>>>>>
>>>>>>>>>> Given that I want to help a user out regarding all this,
>>>>>>>>>> I have a testing project deployed with MyFaces 2.0 on GAE, for
>>>>>>>>>> now
>>>>>>>>>> the
>>>>>>>>>> state saving is server (not tested yet on client)
>>>>>>>>>> GAE supports session handling on its infrastructure with
>>>>>>>>>> memcache,
>>>>>>>>>> but
>>>>>>>>>> here is the problem. I have a basic keepalive enabled which
>>>>>>>>>> should
>>>>>>>>>> refresh the memcache session and keep it alive. This works, but
>>>>>>>>>> occasionally GAE seems to hickup and delivers a null object on
>>>>>>>>>> the
>>>>>>>>>> code which we use to access our serialised view, which results
>>>>>>>>>> in a
>>>>>>>>>> ViewRoot not found exception. Now this is definitely a GAE
>>>>>>>>>> problem,
>>>>>>>>>> but I wonder if we cannot fix it up on our side, maybe by
>>>>>>>>>> triggering
>>>>>>>>>> some API from google.
>>>>>>>>>>
>>>>>>>>>> Here is the example
>>>>>>>>>> http://testinck4040.appspot.com/welcome.jsf
>>>>>>>>>>
>>>>>>>>>> You can leave the browser runnning, especially in the beginning,
>>>>>>>>>> you
>>>>>>>>>> will see this hickup from time to time, as soon as you confirm
>>>>>>>>>> the
>>>>>>>>>> error alert the next ajax request again goes through because the
>>>>>>>>>> subsequent request was again able to restore the viewroot.
>>>>>>>>>> After a while the errors become less or go away, which looks
>>>>>>>>>> eerily
>>>>>>>>>> like caching behavior to me.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I assume this has something to do with GAEs internal way of
>>>>>>>>>> serialising the session from time to time.
>>>>>>>>>> Either way, any ideas or insight on this?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Werner
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>



Re: MyFaces and GAE weird behavior

Posted by Ganesh <ga...@j4fry.org>.
Sure! I always have this request:

menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686

and 1500 time I this response:

<?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>

Then, suddenly I get this one:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"><head>
         <title>Facelet Title</title><script type="text/javascript" src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--

//--></script></head><body><form id="j_id1631913672_61450686" name="j_id1631913672_61450686" method="post" action="/welcome.jsf" enctype="application/x-www-form-urlencoded">
             Selector
             <script type="text/javascript"><!--

                 setInterval(function() {
                     jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu", render:"@none"});
                 }, 100);
                             //--></script><select id="menu" name="menu" size="1" onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2 register','javax.faces.behavior.event':'change'})">    <option value="1">one</option>    <option value="2" selected="selected">two</option></select><select id="menu2" name="menu2" size="1" onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">    <option value="1">one</option>    <option value="2" selected="selected">two</option></select><span id="register">2</span>
             updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT" value="1" /><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ=" /></form>
     Hello dskgfjsfd gjfdlkjg  from Facelets skdjgb kdfsjg<div id="javax_faces_developmentstage_messages"></div></body>
</html>

Some system component gets an hickup after a while ... let me do some additional tests before I submit an issue. Did you try reducing the intervall to 100 and let glassfish run for an hour? On Tomcat this can definitely be reproduced!

Best regards,
Ganesh

Am 13.12.2010 18:28, schrieb Werner Punz:
> Hi I never had a full response in my testing case.
> Not sure how you triggered it in my code as well.
>
> Either way a full response points towards that the server was not interpreting the ajax request as ajax request, which is close to impossible in the standard jsf2 ajax part because the ajax markers are appended at ever request automatically in the code no matter what.
> Can you show me what request is sent downwards which caused the full response instead of the ajax one?
>
>
> Werner
>
>
> Am 13.12.10 18:18, schrieb Ganesh:
>> I had already taken crypto out - running with clean standard
>> configuration, but I'm probably producing a bug different from yours:
>> Once in a while I'm getting a complete HTML response on an XHR request.
>>
>> I'll do some more testing and then open a new bug.
>>
>> Best regards,
>> Ganesh
>>
>> Request:
>> menu=1&menu2=1&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=F8vqQJXUrd4zAZMzy8pO6QpsR0MoQCS001fI%2BaRelCM3BwX5gVhP1F1HbOnrY7di%2BaEzD2dOBzMwrfsplPJBRSeUcyZ%2BBmw6pwlX7DigjiMx9A2oOe7ztPJtY5c%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>
>>
>> Response:
>> <?xml version='1.0' encoding='UTF-8' ?>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>> <html xmlns="http://www.w3.org/1999/xhtml"
>> xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"><head>
>> <title>Facelet Title</title><script type="text/javascript"
>> src="/TestGAE/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>
>>
>> //--></script></head><body><form id="j_id1631913672_61450686"
>> name="j_id1631913672_61450686" method="post"
>> action="/TestGAE/welcome.jsf" enctype="application/x-www-form-urlencoded">
>> Selector
>> <script type="text/javascript"><!--
>>
>> setInterval(function() {
>> jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu",
>> render:"@none"});
>> }, 100);
>> //--></script><select id="menu" name="menu" size="1"
>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>> register','javax.faces.behavior.event':'change'})"> <option value="1"
>> selected="selected">one</option> <option
>> value="2">two</option></select><select id="menu2" name="menu2" size="1"
>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>> <option value="1" selected="selected">one</option> <option
>> value="2">two</option></select><span id="register">1</span>
>> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>> id="javax.faces.ViewState"
>> value="F8vqQJXUrd4zAZMzy8pO6QpsR0MoQCS001fI+aRelCM3BwX5gVhP1F1HbOnrY7diEoaJsT2FQu0wrfsplPJBRSeUcyZ+Bmw6l4QOe8gddH2qxjx8SrlrzKy8qxU="
>> /></form>
>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>> id="javax_faces_developmentstage_messages"></div></body>
>> </html>
>>
>>
>>
>> Am 13.12.2010 16:39, schrieb Werner Punz:
>>> Hi Ganesh take out the encryption entry in the web.xml. For me all
>>> bugs are gone on the defaults.
>>> Or even better turn encryption off entirely in the web.xml by setting
>>> it explicitely on off.
>>> I already raised a bug but since the original bug was caused by a
>>> fault entry in the web.xml on my side and since it is gone entirely
>>> afterwards I closed it again.
>>>
>>>
>>> Werner
>>>
>>>
>>> Am 13.12.10 12:38, schrieb Ganesh:
>>>> Reproduced on Tomcat (had to remove your ezcomp as it uses JEE6 syntax).
>>>> Took several thousand requests to happen (increased firepower by
>>>> decreasing intervall to 100ms). Bug: MyFaces 2.0.2 sometimes answers
>>>> AJAX Request with a full HTML page.
>>>>
>>>> Best regards,
>>>> Ganesh
>>>>
>>>> Am 12.12.2010 15:50, schrieb Werner Punz:
>>>>> Ok I can reproduce the issue locally on glassfish as well by leaving
>>>>> my application running and triggering the ajax requests locally.
>>>>> (Currently testing against glassfish)
>>>>> So GAE is out of the game now. I guess we have a serious bug here, not
>>>>> sure if it is crypto related, I just removed all the keys, to have the
>>>>> app running at defaults. The next step now is to disable crypto
>>>>> entirely. Either way I guess it is time to file a bugreport, this is
>>>>> definitely not GAE anymore.
>>>>>
>>>>> Werner
>>>>>
>>>>>
>>>>>
>>>>> Am 12.12.10 12:08, schrieb Werner Punz:
>>>>>> Ok I have to revert my last mail, I just got the error again despite
>>>>>> having no encryption at all.
>>>>>>
>>>>>> Werner
>>>>>>
>>>>>>
>>>>>> Am 12.12.10 12:05, schrieb Werner Punz:
>>>>>>> Hi the issue seems to be encrypten related, my mistake I set a secret
>>>>>>> and no secret_mac as leo suggested.
>>>>>>> I now removed testwise the encryption entirely and the problem
>>>>>>> seems to
>>>>>>> be gone even for server side state saving.
>>>>>>>
>>>>>>> GAE has improved their session handling, I am still running on server
>>>>>>> side settings with no impact so far, so I do think the general
>>>>>>> recommendation of having to use client side state saving can be
>>>>>>> reverted
>>>>>>> to some degree (there are size limitations for server sessions afaik)
>>>>>>>
>>>>>>> Werber
>>>>>>>
>>>>>>>
>>>>>>> Am 11.12.10 05:15, schrieb Ganesh:
>>>>>>>> Wow, you've invented the AJAX LOIC!
>>>>>>>>
>>>>>>>> After running it a minute with Firebug ON it gives me a different
>>>>>>>> error
>>>>>>>> than you described:
>>>>>>>>
>>>>>>>>
>>>>>>>> First I get about 10-50 successfull AJAX requests (I let it run
>>>>>>>> autonomously, no AJAX request manually triggerd):
>>>>>>>>
>>>>>>>> REQUEST
>>>>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> RESPONSE
>>>>>>>> <?xml version="1.0"
>>>>>>>> encoding="utf-8"?><partial-response><changes><update
>>>>>>>> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Then I get 2 requests where MyFaces suddenly answers the AJAX
>>>>>>>> requests
>>>>>>>> with HTML:
>>>>>>>>
>>>>>>>> REQUEST
>>>>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> RESPONSE
>>>>>>>> <?xml version='1.0' encoding='UTF-8' ?>
>>>>>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>>>>>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>>>>>>>> <html xmlns="http://www.w3.org/1999/xhtml"><head>
>>>>>>>> <title>Facelet Title</title><script type="text/javascript"
>>>>>>>> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> //--></script></head><body><form id="j_id1631913672_61450686"
>>>>>>>> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
>>>>>>>> enctype="application/x-www-form-urlencoded">
>>>>>>>> Selector
>>>>>>>> <script type="text/javascript"><!--
>>>>>>>>
>>>>>>>> setInterval(function() {
>>>>>>>> jsf.ajax.request(document.getElementById("menu"),null,
>>>>>>>> {execute:"menu",
>>>>>>>> render:"@none"});
>>>>>>>> }, 10000);
>>>>>>>> //--></script><select id="menu" name="menu" size="1"
>>>>>>>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>>>>>>>>
>>>>>>>> register','javax.faces.behavior.event':'change'})"> <option
>>>>>>>> value="1">one</option> <option value="2"
>>>>>>>> selected="selected">two</option></select><select id="menu2"
>>>>>>>> name="menu2"
>>>>>>>> size="1"
>>>>>>>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> <option value="1">one</option> <option value="2"
>>>>>>>> selected="selected">two</option></select><span
>>>>>>>> id="register">2</span>
>>>>>>>> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
>>>>>>>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>>>>>>>> id="javax.faces.ViewState"
>>>>>>>> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> /></form>
>>>>>>>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>>>>>>>> id="javax_faces_developmentstage_messages"></div></body>
>>>>>>>> </html>
>>>>>>>>
>>>>>>>> And after exactly two HTML responses the AJAX LOIC stops.
>>>>>>>>
>>>>>>>> Can you confirm this behaviour from your tests? I think I've seen
>>>>>>>> this
>>>>>>>> behaviour when developing the DojoFaces showroom on Tomcat, so maybe
>>>>>>>> it's not GAE specific. I planned to investigate into this since
>>>>>>>> long.
>>>>>>>> Can you please send the LOIC source? I'll direct it on Tomcat and
>>>>>>>> report, whether I can reproduce the behaviour there.
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Ganesh
>>>>>>>>
>>>>>>>> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> I readed your previous emails related to this one and one
>>>>>>>>> possibility
>>>>>>>>> that comes to my mind is we are storing something on session
>>>>>>>>> without
>>>>>>>>> implement Serializable interface. If that so, as soon as GAE
>>>>>>>>> serialize
>>>>>>>>> the session to disk, that code causes an Exception and when MyFaces
>>>>>>>>> try to restore the state it just has dissapeared (servlet
>>>>>>>>> session is
>>>>>>>>> invalid, so a new one is created and our value in
>>>>>>>>> javax.faces.ViewState request parameter is not found, so a
>>>>>>>>> ViewExpiredException is thrown).
>>>>>>>>>
>>>>>>>>> The solution if that is the case is check all lines that do
>>>>>>>>> something
>>>>>>>>> with session map and check if it is possible to serialize to
>>>>>>>>> disk. I
>>>>>>>>> tried the demo but I don't see the exception.
>>>>>>>>>
>>>>>>>>> regards,
>>>>>>>>>
>>>>>>>>> Leonardo Uribe
>>>>>>>>>
>>>>>>>>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>>>>>>>>> <ma...@gmail.com>>
>>>>>>>>>
>>>>>>>>> Hello, I just wanted to discuss some weird behavior I am facing
>>>>>>>>> with
>>>>>>>>> GAE in conjunction with MyFaces I assume this is GAE related but I
>>>>>>>>> just wonder if we can fix or work around it on our side.
>>>>>>>>>
>>>>>>>>> Here is the situation:
>>>>>>>>>
>>>>>>>>> Given that I want to help a user out regarding all this,
>>>>>>>>> I have a testing project deployed with MyFaces 2.0 on GAE, for now
>>>>>>>>> the
>>>>>>>>> state saving is server (not tested yet on client)
>>>>>>>>> GAE supports session handling on its infrastructure with memcache,
>>>>>>>>> but
>>>>>>>>> here is the problem. I have a basic keepalive enabled which should
>>>>>>>>> refresh the memcache session and keep it alive. This works, but
>>>>>>>>> occasionally GAE seems to hickup and delivers a null object on the
>>>>>>>>> code which we use to access our serialised view, which results in a
>>>>>>>>> ViewRoot not found exception. Now this is definitely a GAE problem,
>>>>>>>>> but I wonder if we cannot fix it up on our side, maybe by
>>>>>>>>> triggering
>>>>>>>>> some API from google.
>>>>>>>>>
>>>>>>>>> Here is the example
>>>>>>>>> http://testinck4040.appspot.com/welcome.jsf
>>>>>>>>>
>>>>>>>>> You can leave the browser runnning, especially in the beginning,
>>>>>>>>> you
>>>>>>>>> will see this hickup from time to time, as soon as you confirm the
>>>>>>>>> error alert the next ajax request again goes through because the
>>>>>>>>> subsequent request was again able to restore the viewroot.
>>>>>>>>> After a while the errors become less or go away, which looks eerily
>>>>>>>>> like caching behavior to me.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I assume this has something to do with GAEs internal way of
>>>>>>>>> serialising the session from time to time.
>>>>>>>>> Either way, any ideas or insight on this?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Werner
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>

Re: MyFaces and GAE weird behavior

Posted by Werner Punz <we...@gmail.com>.
Hi I never had a full response in my testing case.
Not sure how you triggered it in my code as well.

Either way a full response points towards that the server was not 
interpreting the ajax request as ajax request, which is close to 
impossible in the standard jsf2 ajax part because the ajax markers are 
appended at ever request automatically in the code no matter what.
Can you show me what request is sent downwards which caused the full 
response instead of the ajax one?


Werner


Am 13.12.10 18:18, schrieb Ganesh:
> I had already taken crypto out - running with clean standard
> configuration, but I'm probably producing a bug different from yours:
> Once in a while I'm getting a complete HTML response on an XHR request.
>
> I'll do some more testing and then open a new bug.
>
> Best regards,
> Ganesh
>
> Request:
> menu=1&menu2=1&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=F8vqQJXUrd4zAZMzy8pO6QpsR0MoQCS001fI%2BaRelCM3BwX5gVhP1F1HbOnrY7di%2BaEzD2dOBzMwrfsplPJBRSeUcyZ%2BBmw6pwlX7DigjiMx9A2oOe7ztPJtY5c%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>
>
> Response:
> <?xml version='1.0' encoding='UTF-8' ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"><head>
> <title>Facelet Title</title><script type="text/javascript"
> src="/TestGAE/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>
>
> //--></script></head><body><form id="j_id1631913672_61450686"
> name="j_id1631913672_61450686" method="post"
> action="/TestGAE/welcome.jsf" enctype="application/x-www-form-urlencoded">
> Selector
> <script type="text/javascript"><!--
>
> setInterval(function() {
> jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu",
> render:"@none"});
> }, 100);
> //--></script><select id="menu" name="menu" size="1"
> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
> register','javax.faces.behavior.event':'change'})"> <option value="1"
> selected="selected">one</option> <option
> value="2">two</option></select><select id="menu2" name="menu2" size="1"
> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
> <option value="1" selected="selected">one</option> <option
> value="2">two</option></select><span id="register">1</span>
> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
> value="1" /><input type="hidden" name="javax.faces.ViewState"
> id="javax.faces.ViewState"
> value="F8vqQJXUrd4zAZMzy8pO6QpsR0MoQCS001fI+aRelCM3BwX5gVhP1F1HbOnrY7diEoaJsT2FQu0wrfsplPJBRSeUcyZ+Bmw6l4QOe8gddH2qxjx8SrlrzKy8qxU="
> /></form>
> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
> id="javax_faces_developmentstage_messages"></div></body>
> </html>
>
>
>
> Am 13.12.2010 16:39, schrieb Werner Punz:
>> Hi Ganesh take out the encryption entry in the web.xml. For me all
>> bugs are gone on the defaults.
>> Or even better turn encryption off entirely in the web.xml by setting
>> it explicitely on off.
>> I already raised a bug but since the original bug was caused by a
>> fault entry in the web.xml on my side and since it is gone entirely
>> afterwards I closed it again.
>>
>>
>> Werner
>>
>>
>> Am 13.12.10 12:38, schrieb Ganesh:
>>> Reproduced on Tomcat (had to remove your ezcomp as it uses JEE6 syntax).
>>> Took several thousand requests to happen (increased firepower by
>>> decreasing intervall to 100ms). Bug: MyFaces 2.0.2 sometimes answers
>>> AJAX Request with a full HTML page.
>>>
>>> Best regards,
>>> Ganesh
>>>
>>> Am 12.12.2010 15:50, schrieb Werner Punz:
>>>> Ok I can reproduce the issue locally on glassfish as well by leaving
>>>> my application running and triggering the ajax requests locally.
>>>> (Currently testing against glassfish)
>>>> So GAE is out of the game now. I guess we have a serious bug here, not
>>>> sure if it is crypto related, I just removed all the keys, to have the
>>>> app running at defaults. The next step now is to disable crypto
>>>> entirely. Either way I guess it is time to file a bugreport, this is
>>>> definitely not GAE anymore.
>>>>
>>>> Werner
>>>>
>>>>
>>>>
>>>> Am 12.12.10 12:08, schrieb Werner Punz:
>>>>> Ok I have to revert my last mail, I just got the error again despite
>>>>> having no encryption at all.
>>>>>
>>>>> Werner
>>>>>
>>>>>
>>>>> Am 12.12.10 12:05, schrieb Werner Punz:
>>>>>> Hi the issue seems to be encrypten related, my mistake I set a secret
>>>>>> and no secret_mac as leo suggested.
>>>>>> I now removed testwise the encryption entirely and the problem
>>>>>> seems to
>>>>>> be gone even for server side state saving.
>>>>>>
>>>>>> GAE has improved their session handling, I am still running on server
>>>>>> side settings with no impact so far, so I do think the general
>>>>>> recommendation of having to use client side state saving can be
>>>>>> reverted
>>>>>> to some degree (there are size limitations for server sessions afaik)
>>>>>>
>>>>>> Werber
>>>>>>
>>>>>>
>>>>>> Am 11.12.10 05:15, schrieb Ganesh:
>>>>>>> Wow, you've invented the AJAX LOIC!
>>>>>>>
>>>>>>> After running it a minute with Firebug ON it gives me a different
>>>>>>> error
>>>>>>> than you described:
>>>>>>>
>>>>>>>
>>>>>>> First I get about 10-50 successfull AJAX requests (I let it run
>>>>>>> autonomously, no AJAX request manually triggerd):
>>>>>>>
>>>>>>> REQUEST
>>>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> RESPONSE
>>>>>>> <?xml version="1.0"
>>>>>>> encoding="utf-8"?><partial-response><changes><update
>>>>>>> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Then I get 2 requests where MyFaces suddenly answers the AJAX
>>>>>>> requests
>>>>>>> with HTML:
>>>>>>>
>>>>>>> REQUEST
>>>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> RESPONSE
>>>>>>> <?xml version='1.0' encoding='UTF-8' ?>
>>>>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>>>>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>>>>>>> <html xmlns="http://www.w3.org/1999/xhtml"><head>
>>>>>>> <title>Facelet Title</title><script type="text/javascript"
>>>>>>> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> //--></script></head><body><form id="j_id1631913672_61450686"
>>>>>>> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
>>>>>>> enctype="application/x-www-form-urlencoded">
>>>>>>> Selector
>>>>>>> <script type="text/javascript"><!--
>>>>>>>
>>>>>>> setInterval(function() {
>>>>>>> jsf.ajax.request(document.getElementById("menu"),null,
>>>>>>> {execute:"menu",
>>>>>>> render:"@none"});
>>>>>>> }, 10000);
>>>>>>> //--></script><select id="menu" name="menu" size="1"
>>>>>>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>>>>>>>
>>>>>>> register','javax.faces.behavior.event':'change'})"> <option
>>>>>>> value="1">one</option> <option value="2"
>>>>>>> selected="selected">two</option></select><select id="menu2"
>>>>>>> name="menu2"
>>>>>>> size="1"
>>>>>>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> <option value="1">one</option> <option value="2"
>>>>>>> selected="selected">two</option></select><span
>>>>>>> id="register">2</span>
>>>>>>> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
>>>>>>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>>>>>>> id="javax.faces.ViewState"
>>>>>>> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> /></form>
>>>>>>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>>>>>>> id="javax_faces_developmentstage_messages"></div></body>
>>>>>>> </html>
>>>>>>>
>>>>>>> And after exactly two HTML responses the AJAX LOIC stops.
>>>>>>>
>>>>>>> Can you confirm this behaviour from your tests? I think I've seen
>>>>>>> this
>>>>>>> behaviour when developing the DojoFaces showroom on Tomcat, so maybe
>>>>>>> it's not GAE specific. I planned to investigate into this since
>>>>>>> long.
>>>>>>> Can you please send the LOIC source? I'll direct it on Tomcat and
>>>>>>> report, whether I can reproduce the behaviour there.
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Ganesh
>>>>>>>
>>>>>>> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> I readed your previous emails related to this one and one
>>>>>>>> possibility
>>>>>>>> that comes to my mind is we are storing something on session
>>>>>>>> without
>>>>>>>> implement Serializable interface. If that so, as soon as GAE
>>>>>>>> serialize
>>>>>>>> the session to disk, that code causes an Exception and when MyFaces
>>>>>>>> try to restore the state it just has dissapeared (servlet
>>>>>>>> session is
>>>>>>>> invalid, so a new one is created and our value in
>>>>>>>> javax.faces.ViewState request parameter is not found, so a
>>>>>>>> ViewExpiredException is thrown).
>>>>>>>>
>>>>>>>> The solution if that is the case is check all lines that do
>>>>>>>> something
>>>>>>>> with session map and check if it is possible to serialize to
>>>>>>>> disk. I
>>>>>>>> tried the demo but I don't see the exception.
>>>>>>>>
>>>>>>>> regards,
>>>>>>>>
>>>>>>>> Leonardo Uribe
>>>>>>>>
>>>>>>>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>>>>>>>> <ma...@gmail.com>>
>>>>>>>>
>>>>>>>> Hello, I just wanted to discuss some weird behavior I am facing
>>>>>>>> with
>>>>>>>> GAE in conjunction with MyFaces I assume this is GAE related but I
>>>>>>>> just wonder if we can fix or work around it on our side.
>>>>>>>>
>>>>>>>> Here is the situation:
>>>>>>>>
>>>>>>>> Given that I want to help a user out regarding all this,
>>>>>>>> I have a testing project deployed with MyFaces 2.0 on GAE, for now
>>>>>>>> the
>>>>>>>> state saving is server (not tested yet on client)
>>>>>>>> GAE supports session handling on its infrastructure with memcache,
>>>>>>>> but
>>>>>>>> here is the problem. I have a basic keepalive enabled which should
>>>>>>>> refresh the memcache session and keep it alive. This works, but
>>>>>>>> occasionally GAE seems to hickup and delivers a null object on the
>>>>>>>> code which we use to access our serialised view, which results in a
>>>>>>>> ViewRoot not found exception. Now this is definitely a GAE problem,
>>>>>>>> but I wonder if we cannot fix it up on our side, maybe by
>>>>>>>> triggering
>>>>>>>> some API from google.
>>>>>>>>
>>>>>>>> Here is the example
>>>>>>>> http://testinck4040.appspot.com/welcome.jsf
>>>>>>>>
>>>>>>>> You can leave the browser runnning, especially in the beginning,
>>>>>>>> you
>>>>>>>> will see this hickup from time to time, as soon as you confirm the
>>>>>>>> error alert the next ajax request again goes through because the
>>>>>>>> subsequent request was again able to restore the viewroot.
>>>>>>>> After a while the errors become less or go away, which looks eerily
>>>>>>>> like caching behavior to me.
>>>>>>>>
>>>>>>>>
>>>>>>>> I assume this has something to do with GAEs internal way of
>>>>>>>> serialising the session from time to time.
>>>>>>>> Either way, any ideas or insight on this?
>>>>>>>>
>>>>>>>>
>>>>>>>> Werner
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>



Re: MyFaces and GAE weird behavior

Posted by Ganesh <ga...@j4fry.org>.
I had already taken crypto out - running with clean standard configuration, but I'm probably producing a bug different from yours: Once in a while I'm getting a complete HTML response on an XHR request.

I'll do some more testing and then open a new bug.

Best regards,
Ganesh

Request:
menu=1&menu2=1&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=F8vqQJXUrd4zAZMzy8pO6QpsR0MoQCS001fI%2BaRelCM3BwX5gVhP1F1HbOnrY7di%2BaEzD2dOBzMwrfsplPJBRSeUcyZ%2BBmw6pwlX7DigjiMx9A2oOe7ztPJtY5c%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686

Response:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"><head>
         <title>Facelet Title</title><script type="text/javascript" src="/TestGAE/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--

//--></script></head><body><form id="j_id1631913672_61450686" name="j_id1631913672_61450686" method="post" action="/TestGAE/welcome.jsf" enctype="application/x-www-form-urlencoded">
             Selector
             <script type="text/javascript"><!--

                 setInterval(function() {
                     jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu", render:"@none"});
                 }, 100);
                 
             
//--></script><select id="menu" name="menu" size="1" onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2 register','javax.faces.behavior.event':'change'})">	<option value="1" selected="selected">one</option>	<option value="2">two</option></select><select id="menu2" name="menu2" size="1" onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">	<option value="1" selected="selected">one</option>	<option value="2">two</option></select><span id="register">1</span>
             updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT" value="1" /><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="F8vqQJXUrd4zAZMzy8pO6QpsR0MoQCS001fI+aRelCM3BwX5gVhP1F1HbOnrY7diEoaJsT2FQu0wrfsplPJBRSeUcyZ+Bmw6l4QOe8gddH2qxjx8SrlrzKy8qxU=" /></form>
     Hello dskgfjsfd gjfdlkjg  from Facelets skdjgb kdfsjg<div id="javax_faces_developmentstage_messages"></div></body>
</html>



Am 13.12.2010 16:39, schrieb Werner Punz:
> Hi Ganesh take out the encryption entry in the web.xml. For me all bugs are gone on the defaults.
> Or even better turn encryption off entirely in the web.xml by setting it explicitely on off.
> I already raised a bug but since the original bug was caused by a fault entry in the web.xml on my side and since it is gone entirely afterwards I closed it again.
>
>
> Werner
>
>
> Am 13.12.10 12:38, schrieb Ganesh:
>> Reproduced on Tomcat (had to remove your ezcomp as it uses JEE6 syntax).
>> Took several thousand requests to happen (increased firepower by
>> decreasing intervall to 100ms). Bug: MyFaces 2.0.2 sometimes answers
>> AJAX Request with a full HTML page.
>>
>> Best regards,
>> Ganesh
>>
>> Am 12.12.2010 15:50, schrieb Werner Punz:
>>> Ok I can reproduce the issue locally on glassfish as well by leaving
>>> my application running and triggering the ajax requests locally.
>>> (Currently testing against glassfish)
>>> So GAE is out of the game now. I guess we have a serious bug here, not
>>> sure if it is crypto related, I just removed all the keys, to have the
>>> app running at defaults. The next step now is to disable crypto
>>> entirely. Either way I guess it is time to file a bugreport, this is
>>> definitely not GAE anymore.
>>>
>>> Werner
>>>
>>>
>>>
>>> Am 12.12.10 12:08, schrieb Werner Punz:
>>>> Ok I have to revert my last mail, I just got the error again despite
>>>> having no encryption at all.
>>>>
>>>> Werner
>>>>
>>>>
>>>> Am 12.12.10 12:05, schrieb Werner Punz:
>>>>> Hi the issue seems to be encrypten related, my mistake I set a secret
>>>>> and no secret_mac as leo suggested.
>>>>> I now removed testwise the encryption entirely and the problem seems to
>>>>> be gone even for server side state saving.
>>>>>
>>>>> GAE has improved their session handling, I am still running on server
>>>>> side settings with no impact so far, so I do think the general
>>>>> recommendation of having to use client side state saving can be
>>>>> reverted
>>>>> to some degree (there are size limitations for server sessions afaik)
>>>>>
>>>>> Werber
>>>>>
>>>>>
>>>>> Am 11.12.10 05:15, schrieb Ganesh:
>>>>>> Wow, you've invented the AJAX LOIC!
>>>>>>
>>>>>> After running it a minute with Firebug ON it gives me a different
>>>>>> error
>>>>>> than you described:
>>>>>>
>>>>>>
>>>>>> First I get about 10-50 successfull AJAX requests (I let it run
>>>>>> autonomously, no AJAX request manually triggerd):
>>>>>>
>>>>>> REQUEST
>>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> RESPONSE
>>>>>> <?xml version="1.0"
>>>>>> encoding="utf-8"?><partial-response><changes><update
>>>>>> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Then I get 2 requests where MyFaces suddenly answers the AJAX requests
>>>>>> with HTML:
>>>>>>
>>>>>> REQUEST
>>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> RESPONSE
>>>>>> <?xml version='1.0' encoding='UTF-8' ?>
>>>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>>>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>>>>>> <html xmlns="http://www.w3.org/1999/xhtml"><head>
>>>>>> <title>Facelet Title</title><script type="text/javascript"
>>>>>> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> //--></script></head><body><form id="j_id1631913672_61450686"
>>>>>> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
>>>>>> enctype="application/x-www-form-urlencoded">
>>>>>> Selector
>>>>>> <script type="text/javascript"><!--
>>>>>>
>>>>>> setInterval(function() {
>>>>>> jsf.ajax.request(document.getElementById("menu"),null,
>>>>>> {execute:"menu",
>>>>>> render:"@none"});
>>>>>> }, 10000);
>>>>>> //--></script><select id="menu" name="menu" size="1"
>>>>>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>>>>>> register','javax.faces.behavior.event':'change'})"> <option
>>>>>> value="1">one</option> <option value="2"
>>>>>> selected="selected">two</option></select><select id="menu2"
>>>>>> name="menu2"
>>>>>> size="1"
>>>>>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>>>>>>
>>>>>>
>>>>>>
>>>>>> <option value="1">one</option> <option value="2"
>>>>>> selected="selected">two</option></select><span id="register">2</span>
>>>>>> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
>>>>>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>>>>>> id="javax.faces.ViewState"
>>>>>> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
>>>>>>
>>>>>>
>>>>>>
>>>>>> /></form>
>>>>>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>>>>>> id="javax_faces_developmentstage_messages"></div></body>
>>>>>> </html>
>>>>>>
>>>>>> And after exactly two HTML responses the AJAX LOIC stops.
>>>>>>
>>>>>> Can you confirm this behaviour from your tests? I think I've seen this
>>>>>> behaviour when developing the DojoFaces showroom on Tomcat, so maybe
>>>>>> it's not GAE specific. I planned to investigate into this since long.
>>>>>> Can you please send the LOIC source? I'll direct it on Tomcat and
>>>>>> report, whether I can reproduce the behaviour there.
>>>>>>
>>>>>> Best regards,
>>>>>> Ganesh
>>>>>>
>>>>>> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>>>>>>> Hi
>>>>>>>
>>>>>>> I readed your previous emails related to this one and one possibility
>>>>>>> that comes to my mind is we are storing something on session without
>>>>>>> implement Serializable interface. If that so, as soon as GAE
>>>>>>> serialize
>>>>>>> the session to disk, that code causes an Exception and when MyFaces
>>>>>>> try to restore the state it just has dissapeared (servlet session is
>>>>>>> invalid, so a new one is created and our value in
>>>>>>> javax.faces.ViewState request parameter is not found, so a
>>>>>>> ViewExpiredException is thrown).
>>>>>>>
>>>>>>> The solution if that is the case is check all lines that do something
>>>>>>> with session map and check if it is possible to serialize to disk. I
>>>>>>> tried the demo but I don't see the exception.
>>>>>>>
>>>>>>> regards,
>>>>>>>
>>>>>>> Leonardo Uribe
>>>>>>>
>>>>>>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>>>>>>> <ma...@gmail.com>>
>>>>>>>
>>>>>>> Hello, I just wanted to discuss some weird behavior I am facing with
>>>>>>> GAE in conjunction with MyFaces I assume this is GAE related but I
>>>>>>> just wonder if we can fix or work around it on our side.
>>>>>>>
>>>>>>> Here is the situation:
>>>>>>>
>>>>>>> Given that I want to help a user out regarding all this,
>>>>>>> I have a testing project deployed with MyFaces 2.0 on GAE, for now
>>>>>>> the
>>>>>>> state saving is server (not tested yet on client)
>>>>>>> GAE supports session handling on its infrastructure with memcache,
>>>>>>> but
>>>>>>> here is the problem. I have a basic keepalive enabled which should
>>>>>>> refresh the memcache session and keep it alive. This works, but
>>>>>>> occasionally GAE seems to hickup and delivers a null object on the
>>>>>>> code which we use to access our serialised view, which results in a
>>>>>>> ViewRoot not found exception. Now this is definitely a GAE problem,
>>>>>>> but I wonder if we cannot fix it up on our side, maybe by triggering
>>>>>>> some API from google.
>>>>>>>
>>>>>>> Here is the example
>>>>>>> http://testinck4040.appspot.com/welcome.jsf
>>>>>>>
>>>>>>> You can leave the browser runnning, especially in the beginning, you
>>>>>>> will see this hickup from time to time, as soon as you confirm the
>>>>>>> error alert the next ajax request again goes through because the
>>>>>>> subsequent request was again able to restore the viewroot.
>>>>>>> After a while the errors become less or go away, which looks eerily
>>>>>>> like caching behavior to me.
>>>>>>>
>>>>>>>
>>>>>>> I assume this has something to do with GAEs internal way of
>>>>>>> serialising the session from time to time.
>>>>>>> Either way, any ideas or insight on this?
>>>>>>>
>>>>>>>
>>>>>>> Werner
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>

-- 
"There are two kinds of people in the world, those who believe there are two kinds of people and those who don't."
— Robert Benchley

Re: MyFaces and GAE weird behavior

Posted by Werner Punz <we...@gmail.com>.
Hi Ganesh take out the encryption entry in the web.xml. For me all bugs 
are gone on the defaults.
Or even better turn encryption off entirely in the web.xml by setting it 
explicitely on off.
I already raised a bug but since the original bug was caused by a fault 
entry in the web.xml on my side and since it is gone entirely afterwards 
I closed it again.


Werner


Am 13.12.10 12:38, schrieb Ganesh:
> Reproduced on Tomcat (had to remove your ezcomp as it uses JEE6 syntax).
> Took several thousand requests to happen (increased firepower by
> decreasing intervall to 100ms). Bug: MyFaces 2.0.2 sometimes answers
> AJAX Request with a full HTML page.
>
> Best regards,
> Ganesh
>
> Am 12.12.2010 15:50, schrieb Werner Punz:
>> Ok I can reproduce the issue locally on glassfish as well by leaving
>> my application running and triggering the ajax requests locally.
>> (Currently testing against glassfish)
>> So GAE is out of the game now. I guess we have a serious bug here, not
>> sure if it is crypto related, I just removed all the keys, to have the
>> app running at defaults. The next step now is to disable crypto
>> entirely. Either way I guess it is time to file a bugreport, this is
>> definitely not GAE anymore.
>>
>> Werner
>>
>>
>>
>> Am 12.12.10 12:08, schrieb Werner Punz:
>>> Ok I have to revert my last mail, I just got the error again despite
>>> having no encryption at all.
>>>
>>> Werner
>>>
>>>
>>> Am 12.12.10 12:05, schrieb Werner Punz:
>>>> Hi the issue seems to be encrypten related, my mistake I set a secret
>>>> and no secret_mac as leo suggested.
>>>> I now removed testwise the encryption entirely and the problem seems to
>>>> be gone even for server side state saving.
>>>>
>>>> GAE has improved their session handling, I am still running on server
>>>> side settings with no impact so far, so I do think the general
>>>> recommendation of having to use client side state saving can be
>>>> reverted
>>>> to some degree (there are size limitations for server sessions afaik)
>>>>
>>>> Werber
>>>>
>>>>
>>>> Am 11.12.10 05:15, schrieb Ganesh:
>>>>> Wow, you've invented the AJAX LOIC!
>>>>>
>>>>> After running it a minute with Firebug ON it gives me a different
>>>>> error
>>>>> than you described:
>>>>>
>>>>>
>>>>> First I get about 10-50 successfull AJAX requests (I let it run
>>>>> autonomously, no AJAX request manually triggerd):
>>>>>
>>>>> REQUEST
>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> RESPONSE
>>>>> <?xml version="1.0"
>>>>> encoding="utf-8"?><partial-response><changes><update
>>>>> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Then I get 2 requests where MyFaces suddenly answers the AJAX requests
>>>>> with HTML:
>>>>>
>>>>> REQUEST
>>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> RESPONSE
>>>>> <?xml version='1.0' encoding='UTF-8' ?>
>>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>>>>> <html xmlns="http://www.w3.org/1999/xhtml"><head>
>>>>> <title>Facelet Title</title><script type="text/javascript"
>>>>> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> //--></script></head><body><form id="j_id1631913672_61450686"
>>>>> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
>>>>> enctype="application/x-www-form-urlencoded">
>>>>> Selector
>>>>> <script type="text/javascript"><!--
>>>>>
>>>>> setInterval(function() {
>>>>> jsf.ajax.request(document.getElementById("menu"),null,
>>>>> {execute:"menu",
>>>>> render:"@none"});
>>>>> }, 10000);
>>>>> //--></script><select id="menu" name="menu" size="1"
>>>>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>>>>> register','javax.faces.behavior.event':'change'})"> <option
>>>>> value="1">one</option> <option value="2"
>>>>> selected="selected">two</option></select><select id="menu2"
>>>>> name="menu2"
>>>>> size="1"
>>>>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>>>>>
>>>>>
>>>>>
>>>>> <option value="1">one</option> <option value="2"
>>>>> selected="selected">two</option></select><span id="register">2</span>
>>>>> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
>>>>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>>>>> id="javax.faces.ViewState"
>>>>> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
>>>>>
>>>>>
>>>>>
>>>>> /></form>
>>>>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>>>>> id="javax_faces_developmentstage_messages"></div></body>
>>>>> </html>
>>>>>
>>>>> And after exactly two HTML responses the AJAX LOIC stops.
>>>>>
>>>>> Can you confirm this behaviour from your tests? I think I've seen this
>>>>> behaviour when developing the DojoFaces showroom on Tomcat, so maybe
>>>>> it's not GAE specific. I planned to investigate into this since long.
>>>>> Can you please send the LOIC source? I'll direct it on Tomcat and
>>>>> report, whether I can reproduce the behaviour there.
>>>>>
>>>>> Best regards,
>>>>> Ganesh
>>>>>
>>>>> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>>>>>> Hi
>>>>>>
>>>>>> I readed your previous emails related to this one and one possibility
>>>>>> that comes to my mind is we are storing something on session without
>>>>>> implement Serializable interface. If that so, as soon as GAE
>>>>>> serialize
>>>>>> the session to disk, that code causes an Exception and when MyFaces
>>>>>> try to restore the state it just has dissapeared (servlet session is
>>>>>> invalid, so a new one is created and our value in
>>>>>> javax.faces.ViewState request parameter is not found, so a
>>>>>> ViewExpiredException is thrown).
>>>>>>
>>>>>> The solution if that is the case is check all lines that do something
>>>>>> with session map and check if it is possible to serialize to disk. I
>>>>>> tried the demo but I don't see the exception.
>>>>>>
>>>>>> regards,
>>>>>>
>>>>>> Leonardo Uribe
>>>>>>
>>>>>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>>>>>> <ma...@gmail.com>>
>>>>>>
>>>>>> Hello, I just wanted to discuss some weird behavior I am facing with
>>>>>> GAE in conjunction with MyFaces I assume this is GAE related but I
>>>>>> just wonder if we can fix or work around it on our side.
>>>>>>
>>>>>> Here is the situation:
>>>>>>
>>>>>> Given that I want to help a user out regarding all this,
>>>>>> I have a testing project deployed with MyFaces 2.0 on GAE, for now
>>>>>> the
>>>>>> state saving is server (not tested yet on client)
>>>>>> GAE supports session handling on its infrastructure with memcache,
>>>>>> but
>>>>>> here is the problem. I have a basic keepalive enabled which should
>>>>>> refresh the memcache session and keep it alive. This works, but
>>>>>> occasionally GAE seems to hickup and delivers a null object on the
>>>>>> code which we use to access our serialised view, which results in a
>>>>>> ViewRoot not found exception. Now this is definitely a GAE problem,
>>>>>> but I wonder if we cannot fix it up on our side, maybe by triggering
>>>>>> some API from google.
>>>>>>
>>>>>> Here is the example
>>>>>> http://testinck4040.appspot.com/welcome.jsf
>>>>>>
>>>>>> You can leave the browser runnning, especially in the beginning, you
>>>>>> will see this hickup from time to time, as soon as you confirm the
>>>>>> error alert the next ajax request again goes through because the
>>>>>> subsequent request was again able to restore the viewroot.
>>>>>> After a while the errors become less or go away, which looks eerily
>>>>>> like caching behavior to me.
>>>>>>
>>>>>>
>>>>>> I assume this has something to do with GAEs internal way of
>>>>>> serialising the session from time to time.
>>>>>> Either way, any ideas or insight on this?
>>>>>>
>>>>>>
>>>>>> Werner
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>



Re: MyFaces and GAE weird behavior

Posted by Ganesh <ga...@j4fry.org>.
Reproduced on Tomcat (had to remove your ezcomp as it uses JEE6 syntax). Took several thousand requests to happen (increased firepower by decreasing intervall to 100ms). Bug: MyFaces 2.0.2 sometimes answers AJAX Request with a full HTML page.

Best regards,
Ganesh

Am 12.12.2010 15:50, schrieb Werner Punz:
> Ok I can reproduce the issue locally on glassfish as well by leaving my application running and triggering the ajax requests locally.
> (Currently testing against glassfish)
> So GAE is out of the game now. I guess we have a serious bug here, not sure if it is crypto related, I just removed all the keys, to have the app running at defaults. The next step now is to disable crypto entirely. Either way I guess it is time to file a bugreport, this is definitely not GAE anymore.
>
> Werner
>
>
>
> Am 12.12.10 12:08, schrieb Werner Punz:
>> Ok I have to revert my last mail, I just got the error again despite
>> having no encryption at all.
>>
>> Werner
>>
>>
>> Am 12.12.10 12:05, schrieb Werner Punz:
>>> Hi the issue seems to be encrypten related, my mistake I set a secret
>>> and no secret_mac as leo suggested.
>>> I now removed testwise the encryption entirely and the problem seems to
>>> be gone even for server side state saving.
>>>
>>> GAE has improved their session handling, I am still running on server
>>> side settings with no impact so far, so I do think the general
>>> recommendation of having to use client side state saving can be reverted
>>> to some degree (there are size limitations for server sessions afaik)
>>>
>>> Werber
>>>
>>>
>>> Am 11.12.10 05:15, schrieb Ganesh:
>>>> Wow, you've invented the AJAX LOIC!
>>>>
>>>> After running it a minute with Firebug ON it gives me a different error
>>>> than you described:
>>>>
>>>>
>>>> First I get about 10-50 successfull AJAX requests (I let it run
>>>> autonomously, no AJAX request manually triggerd):
>>>>
>>>> REQUEST
>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>
>>>>
>>>>
>>>>
>>>> RESPONSE
>>>> <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update
>>>> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Then I get 2 requests where MyFaces suddenly answers the AJAX requests
>>>> with HTML:
>>>>
>>>> REQUEST
>>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>>
>>>>
>>>>
>>>>
>>>> RESPONSE
>>>> <?xml version='1.0' encoding='UTF-8' ?>
>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>>>> <html xmlns="http://www.w3.org/1999/xhtml"><head>
>>>> <title>Facelet Title</title><script type="text/javascript"
>>>> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>>>
>>>>
>>>>
>>>>
>>>> //--></script></head><body><form id="j_id1631913672_61450686"
>>>> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
>>>> enctype="application/x-www-form-urlencoded">
>>>> Selector
>>>> <script type="text/javascript"><!--
>>>>
>>>> setInterval(function() {
>>>> jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu",
>>>> render:"@none"});
>>>> }, 10000);
>>>> //--></script><select id="menu" name="menu" size="1"
>>>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>>>> register','javax.faces.behavior.event':'change'})"> <option
>>>> value="1">one</option> <option value="2"
>>>> selected="selected">two</option></select><select id="menu2" name="menu2"
>>>> size="1"
>>>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>>>>
>>>>
>>>> <option value="1">one</option> <option value="2"
>>>> selected="selected">two</option></select><span id="register">2</span>
>>>> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
>>>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>>>> id="javax.faces.ViewState"
>>>> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
>>>>
>>>>
>>>> /></form>
>>>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>>>> id="javax_faces_developmentstage_messages"></div></body>
>>>> </html>
>>>>
>>>> And after exactly two HTML responses the AJAX LOIC stops.
>>>>
>>>> Can you confirm this behaviour from your tests? I think I've seen this
>>>> behaviour when developing the DojoFaces showroom on Tomcat, so maybe
>>>> it's not GAE specific. I planned to investigate into this since long.
>>>> Can you please send the LOIC source? I'll direct it on Tomcat and
>>>> report, whether I can reproduce the behaviour there.
>>>>
>>>> Best regards,
>>>> Ganesh
>>>>
>>>> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>>>>> Hi
>>>>>
>>>>> I readed your previous emails related to this one and one possibility
>>>>> that comes to my mind is we are storing something on session without
>>>>> implement Serializable interface. If that so, as soon as GAE serialize
>>>>> the session to disk, that code causes an Exception and when MyFaces
>>>>> try to restore the state it just has dissapeared (servlet session is
>>>>> invalid, so a new one is created and our value in
>>>>> javax.faces.ViewState request parameter is not found, so a
>>>>> ViewExpiredException is thrown).
>>>>>
>>>>> The solution if that is the case is check all lines that do something
>>>>> with session map and check if it is possible to serialize to disk. I
>>>>> tried the demo but I don't see the exception.
>>>>>
>>>>> regards,
>>>>>
>>>>> Leonardo Uribe
>>>>>
>>>>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>>>>> <ma...@gmail.com>>
>>>>>
>>>>> Hello, I just wanted to discuss some weird behavior I am facing with
>>>>> GAE in conjunction with MyFaces I assume this is GAE related but I
>>>>> just wonder if we can fix or work around it on our side.
>>>>>
>>>>> Here is the situation:
>>>>>
>>>>> Given that I want to help a user out regarding all this,
>>>>> I have a testing project deployed with MyFaces 2.0 on GAE, for now the
>>>>> state saving is server (not tested yet on client)
>>>>> GAE supports session handling on its infrastructure with memcache, but
>>>>> here is the problem. I have a basic keepalive enabled which should
>>>>> refresh the memcache session and keep it alive. This works, but
>>>>> occasionally GAE seems to hickup and delivers a null object on the
>>>>> code which we use to access our serialised view, which results in a
>>>>> ViewRoot not found exception. Now this is definitely a GAE problem,
>>>>> but I wonder if we cannot fix it up on our side, maybe by triggering
>>>>> some API from google.
>>>>>
>>>>> Here is the example
>>>>> http://testinck4040.appspot.com/welcome.jsf
>>>>>
>>>>> You can leave the browser runnning, especially in the beginning, you
>>>>> will see this hickup from time to time, as soon as you confirm the
>>>>> error alert the next ajax request again goes through because the
>>>>> subsequent request was again able to restore the viewroot.
>>>>> After a while the errors become less or go away, which looks eerily
>>>>> like caching behavior to me.
>>>>>
>>>>>
>>>>> I assume this has something to do with GAEs internal way of
>>>>> serialising the session from time to time.
>>>>> Either way, any ideas or insight on this?
>>>>>
>>>>>
>>>>> Werner
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>

-- 
"There are two kinds of people in the world, those who believe there are two kinds of people and those who don't."
— Robert Benchley

Re: MyFaces and GAE weird behavior

Posted by Werner Punz <we...@gmail.com>.
Ok I can reproduce the issue locally on glassfish as well by leaving my 
application running and triggering the ajax requests locally.
(Currently testing against glassfish)
So GAE is out of the game now. I guess we have a serious bug here, not 
sure if it is crypto related, I just removed all the keys, to have the 
app running at defaults. The next step now is to disable crypto 
entirely. Either way I guess it is time to file a bugreport, this is 
definitely not GAE anymore.

Werner



Am 12.12.10 12:08, schrieb Werner Punz:
> Ok I have to revert my last mail, I just got the error again despite
> having no encryption at all.
>
> Werner
>
>
> Am 12.12.10 12:05, schrieb Werner Punz:
>> Hi the issue seems to be encrypten related, my mistake I set a secret
>> and no secret_mac as leo suggested.
>> I now removed testwise the encryption entirely and the problem seems to
>> be gone even for server side state saving.
>>
>> GAE has improved their session handling, I am still running on server
>> side settings with no impact so far, so I do think the general
>> recommendation of having to use client side state saving can be reverted
>> to some degree (there are size limitations for server sessions afaik)
>>
>> Werber
>>
>>
>> Am 11.12.10 05:15, schrieb Ganesh:
>>> Wow, you've invented the AJAX LOIC!
>>>
>>> After running it a minute with Firebug ON it gives me a different error
>>> than you described:
>>>
>>>
>>> First I get about 10-50 successfull AJAX requests (I let it run
>>> autonomously, no AJAX request manually triggerd):
>>>
>>> REQUEST
>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>
>>>
>>>
>>>
>>> RESPONSE
>>> <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update
>>> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>>>
>>>
>>>
>>>
>>>
>>> Then I get 2 requests where MyFaces suddenly answers the AJAX requests
>>> with HTML:
>>>
>>> REQUEST
>>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>>
>>>
>>>
>>>
>>> RESPONSE
>>> <?xml version='1.0' encoding='UTF-8' ?>
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>>> <html xmlns="http://www.w3.org/1999/xhtml"><head>
>>> <title>Facelet Title</title><script type="text/javascript"
>>> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>>
>>>
>>>
>>>
>>> //--></script></head><body><form id="j_id1631913672_61450686"
>>> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
>>> enctype="application/x-www-form-urlencoded">
>>> Selector
>>> <script type="text/javascript"><!--
>>>
>>> setInterval(function() {
>>> jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu",
>>> render:"@none"});
>>> }, 10000);
>>> //--></script><select id="menu" name="menu" size="1"
>>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>>> register','javax.faces.behavior.event':'change'})"> <option
>>> value="1">one</option> <option value="2"
>>> selected="selected">two</option></select><select id="menu2" name="menu2"
>>> size="1"
>>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>>>
>>>
>>> <option value="1">one</option> <option value="2"
>>> selected="selected">two</option></select><span id="register">2</span>
>>> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
>>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>>> id="javax.faces.ViewState"
>>> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
>>>
>>>
>>> /></form>
>>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>>> id="javax_faces_developmentstage_messages"></div></body>
>>> </html>
>>>
>>> And after exactly two HTML responses the AJAX LOIC stops.
>>>
>>> Can you confirm this behaviour from your tests? I think I've seen this
>>> behaviour when developing the DojoFaces showroom on Tomcat, so maybe
>>> it's not GAE specific. I planned to investigate into this since long.
>>> Can you please send the LOIC source? I'll direct it on Tomcat and
>>> report, whether I can reproduce the behaviour there.
>>>
>>> Best regards,
>>> Ganesh
>>>
>>> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>>>> Hi
>>>>
>>>> I readed your previous emails related to this one and one possibility
>>>> that comes to my mind is we are storing something on session without
>>>> implement Serializable interface. If that so, as soon as GAE serialize
>>>> the session to disk, that code causes an Exception and when MyFaces
>>>> try to restore the state it just has dissapeared (servlet session is
>>>> invalid, so a new one is created and our value in
>>>> javax.faces.ViewState request parameter is not found, so a
>>>> ViewExpiredException is thrown).
>>>>
>>>> The solution if that is the case is check all lines that do something
>>>> with session map and check if it is possible to serialize to disk. I
>>>> tried the demo but I don't see the exception.
>>>>
>>>> regards,
>>>>
>>>> Leonardo Uribe
>>>>
>>>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>>>> <ma...@gmail.com>>
>>>>
>>>> Hello, I just wanted to discuss some weird behavior I am facing with
>>>> GAE in conjunction with MyFaces I assume this is GAE related but I
>>>> just wonder if we can fix or work around it on our side.
>>>>
>>>> Here is the situation:
>>>>
>>>> Given that I want to help a user out regarding all this,
>>>> I have a testing project deployed with MyFaces 2.0 on GAE, for now the
>>>> state saving is server (not tested yet on client)
>>>> GAE supports session handling on its infrastructure with memcache, but
>>>> here is the problem. I have a basic keepalive enabled which should
>>>> refresh the memcache session and keep it alive. This works, but
>>>> occasionally GAE seems to hickup and delivers a null object on the
>>>> code which we use to access our serialised view, which results in a
>>>> ViewRoot not found exception. Now this is definitely a GAE problem,
>>>> but I wonder if we cannot fix it up on our side, maybe by triggering
>>>> some API from google.
>>>>
>>>> Here is the example
>>>> http://testinck4040.appspot.com/welcome.jsf
>>>>
>>>> You can leave the browser runnning, especially in the beginning, you
>>>> will see this hickup from time to time, as soon as you confirm the
>>>> error alert the next ajax request again goes through because the
>>>> subsequent request was again able to restore the viewroot.
>>>> After a while the errors become less or go away, which looks eerily
>>>> like caching behavior to me.
>>>>
>>>>
>>>> I assume this has something to do with GAEs internal way of
>>>> serialising the session from time to time.
>>>> Either way, any ideas or insight on this?
>>>>
>>>>
>>>> Werner
>>>>
>>>>
>>>
>>
>>
>>
>
>
>



Re: MyFaces and GAE weird behavior

Posted by Werner Punz <we...@gmail.com>.
Ok I have to revert my last mail, I just got the error again despite 
having no encryption at all.

Werner


Am 12.12.10 12:05, schrieb Werner Punz:
> Hi the issue seems to be encrypten related, my mistake I set a secret
> and no secret_mac as leo suggested.
> I now removed testwise the encryption entirely and the problem seems to
> be gone even for server side state saving.
>
> GAE has improved their session handling, I am still running on server
> side settings with no impact so far, so I do think the general
> recommendation of having to use client side state saving can be reverted
> to some degree (there are size limitations for server sessions afaik)
>
> Werber
>
>
> Am 11.12.10 05:15, schrieb Ganesh:
>> Wow, you've invented the AJAX LOIC!
>>
>> After running it a minute with Firebug ON it gives me a different error
>> than you described:
>>
>>
>> First I get about 10-50 successfull AJAX requests (I let it run
>> autonomously, no AJAX request manually triggerd):
>>
>> REQUEST
>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>
>>
>>
>> RESPONSE
>> <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update
>> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>>
>>
>>
>>
>> Then I get 2 requests where MyFaces suddenly answers the AJAX requests
>> with HTML:
>>
>> REQUEST
>> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>>
>>
>>
>> RESPONSE
>> <?xml version='1.0' encoding='UTF-8' ?>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
>> <html xmlns="http://www.w3.org/1999/xhtml"><head>
>> <title>Facelet Title</title><script type="text/javascript"
>> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>>
>>
>>
>> //--></script></head><body><form id="j_id1631913672_61450686"
>> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
>> enctype="application/x-www-form-urlencoded">
>> Selector
>> <script type="text/javascript"><!--
>>
>> setInterval(function() {
>> jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu",
>> render:"@none"});
>> }, 10000);
>> //--></script><select id="menu" name="menu" size="1"
>> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
>> register','javax.faces.behavior.event':'change'})"> <option
>> value="1">one</option> <option value="2"
>> selected="selected">two</option></select><select id="menu2" name="menu2"
>> size="1"
>> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
>>
>> <option value="1">one</option> <option value="2"
>> selected="selected">two</option></select><span id="register">2</span>
>> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
>> value="1" /><input type="hidden" name="javax.faces.ViewState"
>> id="javax.faces.ViewState"
>> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
>>
>> /></form>
>> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
>> id="javax_faces_developmentstage_messages"></div></body>
>> </html>
>>
>> And after exactly two HTML responses the AJAX LOIC stops.
>>
>> Can you confirm this behaviour from your tests? I think I've seen this
>> behaviour when developing the DojoFaces showroom on Tomcat, so maybe
>> it's not GAE specific. I planned to investigate into this since long.
>> Can you please send the LOIC source? I'll direct it on Tomcat and
>> report, whether I can reproduce the behaviour there.
>>
>> Best regards,
>> Ganesh
>>
>> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>>> Hi
>>>
>>> I readed your previous emails related to this one and one possibility
>>> that comes to my mind is we are storing something on session without
>>> implement Serializable interface. If that so, as soon as GAE serialize
>>> the session to disk, that code causes an Exception and when MyFaces
>>> try to restore the state it just has dissapeared (servlet session is
>>> invalid, so a new one is created and our value in
>>> javax.faces.ViewState request parameter is not found, so a
>>> ViewExpiredException is thrown).
>>>
>>> The solution if that is the case is check all lines that do something
>>> with session map and check if it is possible to serialize to disk. I
>>> tried the demo but I don't see the exception.
>>>
>>> regards,
>>>
>>> Leonardo Uribe
>>>
>>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>>> <ma...@gmail.com>>
>>>
>>> Hello, I just wanted to discuss some weird behavior I am facing with
>>> GAE in conjunction with MyFaces I assume this is GAE related but I
>>> just wonder if we can fix or work around it on our side.
>>>
>>> Here is the situation:
>>>
>>> Given that I want to help a user out regarding all this,
>>> I have a testing project deployed with MyFaces 2.0 on GAE, for now the
>>> state saving is server (not tested yet on client)
>>> GAE supports session handling on its infrastructure with memcache, but
>>> here is the problem. I have a basic keepalive enabled which should
>>> refresh the memcache session and keep it alive. This works, but
>>> occasionally GAE seems to hickup and delivers a null object on the
>>> code which we use to access our serialised view, which results in a
>>> ViewRoot not found exception. Now this is definitely a GAE problem,
>>> but I wonder if we cannot fix it up on our side, maybe by triggering
>>> some API from google.
>>>
>>> Here is the example
>>> http://testinck4040.appspot.com/welcome.jsf
>>>
>>> You can leave the browser runnning, especially in the beginning, you
>>> will see this hickup from time to time, as soon as you confirm the
>>> error alert the next ajax request again goes through because the
>>> subsequent request was again able to restore the viewroot.
>>> After a while the errors become less or go away, which looks eerily
>>> like caching behavior to me.
>>>
>>>
>>> I assume this has something to do with GAEs internal way of
>>> serialising the session from time to time.
>>> Either way, any ideas or insight on this?
>>>
>>>
>>> Werner
>>>
>>>
>>
>
>
>



Re: MyFaces and GAE weird behavior

Posted by Werner Punz <we...@gmail.com>.
Hi the issue seems to be encrypten related, my mistake I set a secret 
and no secret_mac as leo suggested.
I now removed testwise the encryption entirely and the problem seems to 
be gone even for server side state saving.

GAE has improved their session handling, I am still running on server 
side settings with no impact so far, so I do think the general 
recommendation of having to use client side state saving can be reverted 
to some degree (there are size limitations for server sessions afaik)

Werber


Am 11.12.10 05:15, schrieb Ganesh:
> Wow, you've invented the AJAX LOIC!
>
> After running it a minute with Firebug ON it gives me a different error
> than you described:
>
>
> First I get about 10-50 successfull AJAX requests (I let it run
> autonomously, no AJAX request manually triggerd):
>
> REQUEST
> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>
>
> RESPONSE
> <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update
> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>
>
>
> Then I get 2 requests where MyFaces suddenly answers the AJAX requests
> with HTML:
>
> REQUEST
> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>
>
> RESPONSE
> <?xml version='1.0' encoding='UTF-8' ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
> <html xmlns="http://www.w3.org/1999/xhtml"><head>
> <title>Facelet Title</title><script type="text/javascript"
> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>
>
> //--></script></head><body><form id="j_id1631913672_61450686"
> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
> enctype="application/x-www-form-urlencoded">
> Selector
> <script type="text/javascript"><!--
>
> setInterval(function() {
> jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu",
> render:"@none"});
> }, 10000);
> //--></script><select id="menu" name="menu" size="1"
> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
> register','javax.faces.behavior.event':'change'})"> <option
> value="1">one</option> <option value="2"
> selected="selected">two</option></select><select id="menu2" name="menu2"
> size="1"
> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
> <option value="1">one</option> <option value="2"
> selected="selected">two</option></select><span id="register">2</span>
> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
> value="1" /><input type="hidden" name="javax.faces.ViewState"
> id="javax.faces.ViewState"
> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
> /></form>
> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
> id="javax_faces_developmentstage_messages"></div></body>
> </html>
>
> And after exactly two HTML responses the AJAX LOIC stops.
>
> Can you confirm this behaviour from your tests? I think I've seen this
> behaviour when developing the DojoFaces showroom on Tomcat, so maybe
> it's not GAE specific. I planned to investigate into this since long.
> Can you please send the LOIC source? I'll direct it on Tomcat and
> report, whether I can reproduce the behaviour there.
>
> Best regards,
> Ganesh
>
> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>> Hi
>>
>> I readed your previous emails related to this one and one possibility
>> that comes to my mind is we are storing something on session without
>> implement Serializable interface. If that so, as soon as GAE serialize
>> the session to disk, that code causes an Exception and when MyFaces
>> try to restore the state it just has dissapeared (servlet session is
>> invalid, so a new one is created and our value in
>> javax.faces.ViewState request parameter is not found, so a
>> ViewExpiredException is thrown).
>>
>> The solution if that is the case is check all lines that do something
>> with session map and check if it is possible to serialize to disk. I
>> tried the demo but I don't see the exception.
>>
>> regards,
>>
>> Leonardo Uribe
>>
>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>> <ma...@gmail.com>>
>>
>> Hello, I just wanted to discuss some weird behavior I am facing with
>> GAE in conjunction with MyFaces I assume this is GAE related but I
>> just wonder if we can fix or work around it on our side.
>>
>> Here is the situation:
>>
>> Given that I want to help a user out regarding all this,
>> I have a testing project deployed with MyFaces 2.0 on GAE, for now the
>> state saving is server (not tested yet on client)
>> GAE supports session handling on its infrastructure with memcache, but
>> here is the problem. I have a basic keepalive enabled which should
>> refresh the memcache session and keep it alive. This works, but
>> occasionally GAE seems to hickup and delivers a null object on the
>> code which we use to access our serialised view, which results in a
>> ViewRoot not found exception. Now this is definitely a GAE problem,
>> but I wonder if we cannot fix it up on our side, maybe by triggering
>> some API from google.
>>
>> Here is the example
>> http://testinck4040.appspot.com/welcome.jsf
>>
>> You can leave the browser runnning, especially in the beginning, you
>> will see this hickup from time to time, as soon as you confirm the
>> error alert the next ajax request again goes through because the
>> subsequent request was again able to restore the viewroot.
>> After a while the errors become less or go away, which looks eerily
>> like caching behavior to me.
>>
>>
>> I assume this has something to do with GAEs internal way of
>> serialising the session from time to time.
>> Either way, any ideas or insight on this?
>>
>>
>> Werner
>>
>>
>



Re: MyFaces and GAE weird behavior

Posted by Werner Punz <we...@gmail.com>.
Sure...

http://people.apache.org/~werpu/tesinck4040.tar.bz2
is the entire project including the maven files. No questions about the 
weird project name though
I was forced more or less to use a stupid one due to GAE.
Btw. the error was not reproducable locally on Jetty.
Have not tried a Tomcat run yet.


Werner



Am 11.12.10 05:15, schrieb Ganesh:
> Wow, you've invented the AJAX LOIC!
>
> After running it a minute with Firebug ON it gives me a different error
> than you described:
>
>
> First I get about 10-50 successfull AJAX requests (I let it run
> autonomously, no AJAX request manually triggerd):
>
> REQUEST
> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>
>
> RESPONSE
> <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update
> id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>
>
>
>
> Then I get 2 requests where MyFaces suddenly answers the AJAX requests
> with HTML:
>
> REQUEST
> menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686
>
>
> RESPONSE
> <?xml version='1.0' encoding='UTF-8' ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
> <html xmlns="http://www.w3.org/1999/xhtml"><head>
> <title>Facelet Title</title><script type="text/javascript"
> src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--
>
>
> //--></script></head><body><form id="j_id1631913672_61450686"
> name="j_id1631913672_61450686" method="post" action="/welcome.jsf"
> enctype="application/x-www-form-urlencoded">
> Selector
> <script type="text/javascript"><!--
>
> setInterval(function() {
> jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu",
> render:"@none"});
> }, 10000);
> //--></script><select id="menu" name="menu" size="1"
> onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2
> register','javax.faces.behavior.event':'change'})"> <option
> value="1">one</option> <option value="2"
> selected="selected">two</option></select><select id="menu2" name="menu2"
> size="1"
> onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">
> <option value="1">one</option> <option value="2"
> selected="selected">two</option></select><span id="register">2</span>
> updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT"
> value="1" /><input type="hidden" name="javax.faces.ViewState"
> id="javax.faces.ViewState"
> value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ="
> /></form>
> Hello dskgfjsfd gjfdlkjg from Facelets skdjgb kdfsjg<div
> id="javax_faces_developmentstage_messages"></div></body>
> </html>
>
> And after exactly two HTML responses the AJAX LOIC stops.
>
> Can you confirm this behaviour from your tests? I think I've seen this
> behaviour when developing the DojoFaces showroom on Tomcat, so maybe
> it's not GAE specific. I planned to investigate into this since long.
> Can you please send the LOIC source? I'll direct it on Tomcat and
> report, whether I can reproduce the behaviour there.
>
> Best regards,
> Ganesh
>
> Am 10.12.2010 17:51, schrieb Leonardo Uribe:
>> Hi
>>
>> I readed your previous emails related to this one and one possibility
>> that comes to my mind is we are storing something on session without
>> implement Serializable interface. If that so, as soon as GAE serialize
>> the session to disk, that code causes an Exception and when MyFaces
>> try to restore the state it just has dissapeared (servlet session is
>> invalid, so a new one is created and our value in
>> javax.faces.ViewState request parameter is not found, so a
>> ViewExpiredException is thrown).
>>
>> The solution if that is the case is check all lines that do something
>> with session map and check if it is possible to serialize to disk. I
>> tried the demo but I don't see the exception.
>>
>> regards,
>>
>> Leonardo Uribe
>>
>> 2010/12/10 Werner Punz <werner.punz@gmail.com
>> <ma...@gmail.com>>
>>
>> Hello, I just wanted to discuss some weird behavior I am facing with
>> GAE in conjunction with MyFaces I assume this is GAE related but I
>> just wonder if we can fix or work around it on our side.
>>
>> Here is the situation:
>>
>> Given that I want to help a user out regarding all this,
>> I have a testing project deployed with MyFaces 2.0 on GAE, for now the
>> state saving is server (not tested yet on client)
>> GAE supports session handling on its infrastructure with memcache, but
>> here is the problem. I have a basic keepalive enabled which should
>> refresh the memcache session and keep it alive. This works, but
>> occasionally GAE seems to hickup and delivers a null object on the
>> code which we use to access our serialised view, which results in a
>> ViewRoot not found exception. Now this is definitely a GAE problem,
>> but I wonder if we cannot fix it up on our side, maybe by triggering
>> some API from google.
>>
>> Here is the example
>> http://testinck4040.appspot.com/welcome.jsf
>>
>> You can leave the browser runnning, especially in the beginning, you
>> will see this hickup from time to time, as soon as you confirm the
>> error alert the next ajax request again goes through because the
>> subsequent request was again able to restore the viewroot.
>> After a while the errors become less or go away, which looks eerily
>> like caching behavior to me.
>>
>>
>> I assume this has something to do with GAEs internal way of
>> serialising the session from time to time.
>> Either way, any ideas or insight on this?
>>
>>
>> Werner
>>
>>
>



Re: MyFaces and GAE weird behavior

Posted by Ganesh <ga...@j4fry.org>.
Wow, you've invented the AJAX LOIC!

After running it a minute with Firebug ON it gives me a different error than you described:


First I get about 10-50 successfull AJAX requests (I let it run autonomously, no AJAX request manually triggerd):

REQUEST
menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexpCqMG8%2FZTjSuzyyp4wTfTQtIRYI2NGNYrowj3xe1Ea5gMnGDCmf4XDHE2t4%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686

RESPONSE
<?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="javax.faces.ViewState"><![CDATA[8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX+29/gA9k66oAqkdcbAYw=]]></update></changes></partial-response>


Then I get 2 requests where MyFaces suddenly answers the AJAX requests with HTML:

REQUEST
menu=2&menu2=2&j_id1631913672_61450686_SUBMIT=1&javax.faces.ViewState=8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc%2Fi5akMf2jX5YAFR9g2TeexsmWaz0OwVCSuzyyp4wTfTQtIRYI2NGNYizaF3VX%2B29%2FgA9k66oAqkdcbAYw%3D&javax.faces.source=menu&javax.faces.partial.ajax=true&javax.faces.partial.execute=menu%20%40this&j_id1631913672_61450686=j_id1631913672_61450686

RESPONSE
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"><head>
         <title>Facelet Title</title><script type="text/javascript" src="/javax.faces.resource/jsf.js.jsf?ln=javax.faces&amp;stage=Development"><!--

//--></script></head><body><form id="j_id1631913672_61450686" name="j_id1631913672_61450686" method="post" action="/welcome.jsf" enctype="application/x-www-form-urlencoded">
             Selector
             <script type="text/javascript"><!--

                 setInterval(function() {
                     jsf.ajax.request(document.getElementById("menu"),null, {execute:"menu", render:"@none"});
                 }, 10000);
                 
             
//--></script><select id="menu" name="menu" size="1" onchange="jsf.ajax.request('menu',event,{execute:'@this',render:'menu2 register','javax.faces.behavior.event':'change'})">	<option value="1">one</option>	<option value="2" selected="selected">two</option></select><select id="menu2" name="menu2" size="1" onchange="jsf.ajax.request('menu2',event,{execute:'@this',render:'register','javax.faces.behavior.event':'change'})">	<option value="1">one</option>	<option value="2" selected="selected">two</option></select><span id="register">2</span>
             updatearea<input type="hidden" name="j_id1631913672_61450686_SUBMIT" value="1" /><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="8EgC7hvJoXWgMHaUZxk5rx66APlnNueyP32ajDxbvc/i5akMf2jX5YAFR9g2TeexZLWjcpLNwuKuzyyp4wTfTQtIRYI2NGNYxG03TD1n1SnzkVnE0HeVBTpV0LQ=" /></form>
     Hello dskgfjsfd gjfdlkjg  from Facelets skdjgb kdfsjg<div id="javax_faces_developmentstage_messages"></div></body>
</html>

And after exactly two HTML responses the AJAX LOIC stops.

Can you confirm this behaviour from your tests? I think I've seen this behaviour when developing the DojoFaces showroom on Tomcat, so maybe it's not GAE specific. I planned to investigate into this since long. Can you please send the LOIC source? I'll direct it on Tomcat and report, whether I can reproduce the behaviour there.

Best regards,
Ganesh

Am 10.12.2010 17:51, schrieb Leonardo Uribe:
> Hi
>
> I readed your previous emails related to this one and one possibility that comes to my mind is we are storing something on session without implement Serializable interface. If that so, as soon as GAE serialize the session to disk, that code causes an Exception and when MyFaces try to restore the state it just has dissapeared (servlet session is invalid, so a new one is created and our value in javax.faces.ViewState request parameter is not found, so a ViewExpiredException is thrown).
>
> The solution if that is the case is check all lines that do something with session map and check if it is possible to serialize to disk. I tried the demo but I don't see the exception.
>
> regards,
>
> Leonardo Uribe
>
> 2010/12/10 Werner Punz <werner.punz@gmail.com <ma...@gmail.com>>
>
>     Hello, I just wanted to discuss some weird behavior I am facing with GAE in conjunction with MyFaces I assume this is GAE related but I just wonder if we can fix or work around it on our side.
>
>     Here is the situation:
>
>     Given that I want to help a user out regarding all this,
>     I have a testing project deployed with MyFaces 2.0 on GAE, for now the state saving is server (not tested yet on client)
>     GAE supports session handling on its infrastructure with memcache, but here is the problem. I have  a basic keepalive enabled which should refresh the memcache session and keep it alive. This works, but occasionally GAE seems to hickup and delivers a null object on the code which we use to access our serialised view, which results in a ViewRoot not found exception. Now this is definitely a GAE problem, but I wonder if we cannot fix it up on our side, maybe by triggering some API from google.
>
>     Here is the example
>     http://testinck4040.appspot.com/welcome.jsf
>
>     You can leave the browser runnning, especially in the beginning, you will see this hickup from time to time, as soon as you confirm the error alert the next ajax request again goes through because the subsequent request was again able to restore the viewroot.
>     After a while the errors become less or go away, which looks eerily like caching behavior to me.
>
>
>     I assume this has something to do with GAEs internal way of serialising the session from time to time.
>     Either way, any ideas or insight on this?
>
>
>     Werner
>
>

Re: MyFaces and GAE weird behavior

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

I readed your previous emails related to this one and one possibility that
comes to my mind is we are storing something on session without implement
Serializable interface. If that so, as soon as GAE serialize the session to
disk, that code causes an Exception and when MyFaces try to restore the
state it just has dissapeared (servlet session is invalid, so a new one is
created and our value in javax.faces.ViewState request parameter is not
found, so a ViewExpiredException is thrown).

The solution if that is the case is check all lines that do something with
session map and check if it is possible to serialize to disk. I tried the
demo but I don't see the exception.

regards,

Leonardo Uribe

2010/12/10 Werner Punz <we...@gmail.com>

> Hello, I just wanted to discuss some weird behavior I am facing with GAE in
> conjunction with MyFaces I assume this is GAE related but I just wonder if
> we can fix or work around it on our side.
>
> Here is the situation:
>
> Given that I want to help a user out regarding all this,
> I have a testing project deployed with MyFaces 2.0 on GAE, for now the
> state saving is server (not tested yet on client)
> GAE supports session handling on its infrastructure with memcache, but here
> is the problem. I have  a basic keepalive enabled which should refresh the
> memcache session and keep it alive. This works, but occasionally GAE seems
> to hickup and delivers a null object on the code which we use to access our
> serialised view, which results in a ViewRoot not found exception. Now this
> is definitely a GAE problem, but I wonder if we cannot fix it up on our
> side, maybe by triggering some API from google.
>
> Here is the example
> http://testinck4040.appspot.com/welcome.jsf
>
> You can leave the browser runnning, especially in the beginning, you will
> see this hickup from time to time, as soon as you confirm the error alert
> the next ajax request again goes through because the subsequent request was
> again able to restore the viewroot.
> After a while the errors become less or go away, which looks eerily like
> caching behavior to me.
>
>
> I assume this has something to do with GAEs internal way of serialising the
> session from time to time.
> Either way, any ideas or insight on this?
>
>
> Werner
>
>