SessionRenderer.render() throws NoClassDefFoundError
[Logo]
Forums for ICEfaces and ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
SessionRenderer.render() throws NoClassDefFoundError  XML
Forum Index -> General Help Go to Page: 1, 2 Next 
Author Message
paulvr

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


When calling SessionRenderer.render() sometimes (but difficult to reproduce) a java.lang.NoClassDefFoundError exception for javax/portlet/PortletSession is thrown. Do I miss a class? Can't find it in any of my libraries... Or is it a bug?

Using JSF 1.2 (in 1.1 compatability mode), IceFaces 1.7.1, FF3, facelets.

Exception in thread "Thread-12" java.lang.NoClassDefFoundError: javax/portlet/PortletSession
at com.icesoft.faces.async.render.GroupAsyncRenderer.requestRender(GroupAsyncRenderer.java:239)
at com.icesoft.faces.async.render.GroupAsyncRenderer.requestRender(GroupAsyncRenderer.java:196)
at org.icefaces.x.core.push.SessionRenderer.render(SessionRenderer.java:86)
[Email]
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


Did you check to see if portlet.jar is included in your deployed package?
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


Of course, that is assuming you are doing a portlet application and have used this class in your application....
paulvr

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


Thanks for your reply.

No, that's point, I don't use portlets, so I didn't include the portlet.jar. But there seems to be some reference to the PortletSession class from inside the SessionRenderer, such that the classloader is called for it, even if I'm not using it.

Regards and thanks, Paul.
[Email]
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


I have used the SessionRenderer (without Portlets) and didn't see this issue at all. Which AS are you using? Did you check to make sure a stray import statement isn't trying to import this class?
paulvr

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


No stray imports, and Eclipse would warn me for that. What's an "AS"?
Paul.
[Email]
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


Application Server (for a lazy typist)
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


list the jars you are deploying with your app (if ear, list those in the ear and those in the war)
paulvr

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


AS = Tomcat 6.0.16

jars:

backport-util-concurrent
commons-beanutils
commons-collections
commons-digester
commons-fileupload
commons-logging
icefaces
icefaces-comps
icefaces-facelets
jsf-api-1.2
jsf-impl-1.2
jstl
krysalis-jCharts-1.0.0-alpha-1
mail
mysql-connector-java
[Email]
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


Looks like the problem may lie in SessionRenderer after all.

Could you please put some decode in com.icesoft.faces.asynch.render.GroupAsyncRenderer.java in the following block?

Code:
         for (Iterator i = group.iterator(); !stopRequested && i.hasNext();) {
             Object object = ((WeakReference) i.next()).get();
             if (object instanceof Renderable) {
                 requestRender((Renderable) object);
             } else if (object instanceof HttpSession) {
                 requestRender((HttpSession) object);
             } else if (object instanceof PortletSession) {
                 requestRender((PortletSession) object);
             }
         }

You can see in the following block of code that the object you are receiving should meet one of the first 2 conditions and it isn't. It would be very helpful to find out what type/class of object you are getting.
paulvr

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


Hi jguglielmin,

I would be glad to help you with debugging the SessionRenderer but I don't have the proper sources, though I did found a com.icesoft.faces.asynch.render.GroupAsyncRenderer.java on the Icefaces website (in the ICEfaces-1.7.1-src.zip library, is that the one?), but this file refers to some other sources I can't find...

Would it be possible for you to send me a jar that does the debug output you would require and that I could link to instead of the IceFaces jar and that writes the info you require to a file or such? Or do you have any better idea?

I tried to create a simple demo of the problem, but the simpler I make it, the less likely it runs into the problem. But there seems to be a positive correlation with the number of calls to the SessionRenderer.render().

############
I noticed that the GroupAsyncRenderer does an "if (object instanceof PortletSession)". This may result in the classloader wanting to load that PortletSession, even if no object of that class exists in the current context. That would already explain my problem. (I had a similar problem once...)
############

Thanks for your help anyway,
regards, Paul.
[Email]
jguglielmin

Joined: 20/07/2007 00:00:00
Messages: 181
Offline


I don't have a lot of time today to devote to this problem. If you want a speedier resolution then you can either download the 1.7.1 source (sounds like you did) put some logging statements or step through your debugger (always a quicker solution) to see why your object is not one of the 2 that it should be. Not sure this is necessarily a buy yet (we'll see what the object is). To rebuild the core jar if you choose to use logging statements, just go into the core folder and type ant (of the Icefaces source code). Then use this jar in your application. You might also want to check and see what type of object your application is adding to the render group.

If you can't figure this out, please open a jira and attach a simple project (maybe scaled down if what you are working on is a large one) to the jira.
paulvr

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


See http://jira.icefaces.org/browse/ICE-3488
[Email]
ted.goddard

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


Are both SessionRenderer.render() and SessionRenderer.addCurrentSession() always called from threads executing the JSF lifecycle? (We are not sure how a null Session value can be added to the map.)
[Email]
paulvr

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


I was calling SessionRenderer.addCurrentSession() in JSF context, but SessionRenderer.render() from an independent, asynchronous thread.
[Email]
 
Forum Index -> General Help Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team