1.8 Final: Problems with onDemandRenderer in new version
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
1.8 Final: Problems with onDemandRenderer in new version  XML
Forum Index -> Development Build Feedback Go to Page: 1, 2 Next 
Author Message
app1swf


Joined: 13/06/2008 00:00:00
Messages: 5
Offline


Our current code uses RenderManager and an onDemandRenderer to push updates to our pages. Currently we are using 1.7.2 and the following code works fine:

renderer = renderManager.getOnDemandRenderer(
FacesContext.getCurrentInstance().getExternalContext
().getSession(false).toString());

renderer.add(this);



Then to push new information, I call:

renderer.requestRender();

All works fine in 1.7.2. Once I switched to the 1.8 jars, I did not get any renders....

After some research, I found that naming the OnDemandRenderer with the session name caused the problem. Why would this now cause an issue? I was able to get it working with the following code changes, but is this what I should be doing?

renderer = renderManager.getOnDemandRenderer(
FacesContext.getCurrentInstance().getExternalContext
().getSession(false).toString() + new DateTime().toString());

renderer.addCurrentSession();


UPDATE: The push is happening randomly and cannot find a pattern. I can get the original code to work some of the time. I can shutdown my server and then start it and the async push works fine. Once I stop and start the server again, now it does not work. Putting back the 1.7.2 jars, fixes the issue. I am also using the blockrequesthandler with auto-detect.
[Email]
deryk.sinotte


Joined: 26/10/2004 00:00:00
Messages: 936
Offline


Do you have more than one application using Ajax Push features? In 1.8, we really recommend using the Push Server for all environments that use Ajax Push.

There's a short section in the release notes:
http://www.icefaces.org/docs/v1_8_0/ReleaseNotes.html#Changes_180

under "New Push Server for Asynchronous (Ajax Push) Applications" and more details in the Developer's Guide.

You might also want to try the SessionRenderer API in a small test case to see if that work as it does basically the same thing as renderer.addCurrentSession() without some of the extra code overhead.

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
app1swf


Joined: 13/06/2008 00:00:00
Messages: 5
Offline


I have actually tried switching to the SessionRenderer and found the same issues. I am using the new Push Server, but the same issues still seem to remain. I am only running one application on my BEA 10.2 server. I can deploy my application and sometimes the Async will work and other times it will not. I see this also when I shutdown my server and then restart it. I have never seen this behavior before using the 1.8 jars. any suggestions would be most appreciated.

Thx,

Scott
[Email]
deryk.sinotte


Joined: 26/10/2004 00:00:00
Messages: 936
Offline


A couple of things to try:

1) Can you try on a different container (like Tomcat) to eliminate WebLogic as a variable?

2) Can you post a simplified test case for us to look at?

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
app1swf


Joined: 13/06/2008 00:00:00
Messages: 5
Offline


I cannot try on Tomcat at this time due to company policies. I would say that it is a problem with the new version, Push-Server and BEA. We are running fine currently with 1.7.2, the only change was to 1.8. I will try and put together a sample app as time permits.
[Email]
paulvr

Joined: 12/05/2008 00:00:00
Messages: 121
Offline


Using the new SessionRenderer I'm seeing the same kind of issues. Calling SessionRenderer.renderGroup("Group") correctly performs a render of all involved views (I see the bean getters being called), but the view is never actually updated. I suspect the DOM diff fails(?).
Simple pages never fail. The more complex the page, the more often it fails to update. I've got quite complex pages with tables inside dynamic tabsets inside tabsets and several <ui:includes>. And the more complex the more likely it fails, so it's quite difficult to find a simple example where it consistently fails, but I'm working on that. FF fails more often than IE.
I'm using Tomcat 6, ICE 1.8.0, PushServer 1.8.0.
Regards, Paul.
[Email]
deryk.sinotte


Joined: 26/10/2004 00:00:00
Messages: 936
Offline


Any luck on a test case that shows the issue?

If you watch Firebug on a render that fails, does the update payload come back empty? This may implicate the DOM diff as not finding anything different between requests for some reason.

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
paulvr

Joined: 12/05/2008 00:00:00
Messages: 121
Offline


Hi Deryk,

If the update succeeds then I see the following in the firebug console:

Code:
[window.FkNG#4.async-connection.ui] [7429753] : receive [200] OK
 [window.FkNG#4] applied update : <span class="iceOutTxt" id="controlform:tabset:2:grouptabset:0:j_id312:0:j_id316:j_id318">...</span>
 [window.FkNG#4] applied update : <input class="iceInpTxt" id="controlform:tabset:2:grouptabset:0:j_id312:0:j_id316:j_id324:0:00:j_id335" name="controlform:tabset:2:grouptabset:0:j_id312:0:j_id316:j_id324:0:00:j_id335" onblur="setFocus('');iceSubmitPartial(form, this, event);" onfocus="setFocus(this.id);" onkeypress="iceSubmit(form,this,event);" size="18" style="text-align: right; color: #080;" type="text" value="18">...</input>
 [window.FkNG#4] applied update : <script id="FkNGwaeLJoIxETHXOEjVKg:4:dynamic-code" type="text/javascript">...</script>
 [window.FkNG#4.async-connection.ui] [7429753] : connection closed
 [window.FkNG#4.async-connection.heartbeat] ping
 [window.FkNG#4.async-connection.ui] [20045] : send asynchronous POST
 


If the update fails (I'm sure the SessionRenderer.render() is called and with the correct parameter), then I don't see anything at all at that moment in the console, just a pong, some time later:
Code:
[window.FkNG#4.async-connection.ui] [258137] : receive [200] OK
 [window.FkNG#4.async-connection.heartbeat] pong
 [window.FkNG#4.async-connection.ui] [258137] : connection closed
 


And, sometimes, at an unpredictable moment, maybe 5 to 10 seconds later, the update may still happen.

I tested this with IE7, FF 3.0.9 and 3.0.10, both on the server and on separate clients.

Regards, Paul.
[Email]
judy.guglielmin

Joined: 20/02/2007 00:00:00
Messages: 1196
Offline


Is there anything posted to the server log that might be of help?
paulvr

Joined: 12/05/2008 00:00:00
Messages: 121
Offline


Hi Judy,
Sorry, I don't see anything interesting. Uploaded the logs.
Regards, Paul.
 Filename access_log.txt [Disk] Download
 Description
 Filesize 558 bytes
 Downloaded:  126 time(s)

 Filename catalina.out [Disk] Download
 Description
 Filesize 3 Kbytes
 Downloaded:  143 time(s)

[Email]
judy.guglielmin

Joined: 20/02/2007 00:00:00
Messages: 1196
Offline


Are you deploying this as a root application?

Apr 30, 2009 10:50:26 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra (1.2_12-b01-FCS) for context '' 
paulvr

Joined: 12/05/2008 00:00:00
Messages: 121
Offline


Yes, that's right.
[Email]
nikhilbhavsar

Joined: 06/08/2009 00:00:00
Messages: 4
Offline


i am facing same problem ..
Any known solution ?
paulvr

Joined: 12/05/2008 00:00:00
Messages: 121
Offline


No solution ...
[Email]
nikhilbhavsar

Joined: 06/08/2009 00:00:00
Messages: 4
Offline


I am using IceFaces outputProgress component in inderminate mode -

The code in the xhtml is -

<ice:outputProgress
indeterminate="true" value="#{bean.percent}"
id="progressBat" rendered="true" />

The backing bean class bean implements following interfaces - Renderable , DisposableBean


On the button click, tha backing bean action is called -

public String buttonClick() throws InterruptedException {

// activity in progress.
setPercent(30);

// call a render to update the component state
try {
renderManager.getOnDemandRenderer(sessionId).requestRender();
} catch (IllegalStateException e) {
getLog().error(this.getClass(),"Error!", e);
}

// call some long processing logic.

for (int i = 0; i < 10000; i++) {
System.out.println("test");
}

// activity completed.
percent = 100;
// call a render to update the component state
try {
renderManager.getOnDemandRenderer(sessionId).requestRender();
} catch (IllegalStateException e) {
getLog().error(this.getClass(),"Error!", e);
}
return ;

}



Somehow, the progress bar is not working ... it does not render progress bar when activity is in progress.
 
Forum Index -> Development Build Feedback Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team