Problems deploying Icefaces within an ear when using JBossWebLoader
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
Problems deploying Icefaces within an ear when using JBossWebLoader  XML
Forum Index -> JBoss Seam Integration
Author Message
cmaclachlan

Joined: 15/08/2006 00:00:00
Messages: 3
Offline


I am having problems deploying a war that uses Icefaces 1.1.5 within an ear in JBoss 4.0.5.

I have no problem deploying an Icefaces .war to the deploy directory. The problem comes when I try and deploy the war within an ear when using the JBoss classloader.

Everything works fine if I have am using the Tomcat class loader (UseJBossWebLoader=false in jbossweb-tomcat55.sar/META-INF/jboss-services.xml).
But if I want to use the JBossWebLoader things start to unravel.

It appears to be a classloader problem. If have tried many combinations of deploying jars to the various lib directories: jbossweb-tomcat55.sar/jsf-libs, web-inf/libs, ear/lib, ear/applib and even server/lib. Unfortunately the application can only be deployed using the JbossWebLoader and thus if I want to use Icefaces (and I do, as it has worked very well in another application) I need to get Icefaces deploying with the JbossWebLoader.

I have followed informative threads in this and other forums but they all dealt with problems of deploying a pure war, not an ear. Any assistance would be greatly appreciated.
diablo341

Joined: 12/11/2006 00:00:00
Messages: 11
Offline


I'm facing a similar issue. You've probably seen my post in this forum. I also have a post in the JBoss Seam forum.

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=94822&postdays=0&postorder=asc&start=20

There are some good responses, but I haven't had a chance to try any solutions. How is it that an ArrayList class can be loaded in an EJB classloader, saved in the context, accessed by the presentation layer, and work fine, yet the same doesn't work if the class is an ICEfaces class? I'm not that familiar with classloading, but from what I've read, a classloader that loads a class in the EJB layer would look like:

ejbClassLoader.java.util.List

In the WAR layer, it would be:

warClassLoader.java.util.List

Is this accurate? Is this an example of being strongly-typed? Below is the the response I got that led me to the above example:
This sounds similar to a few other issues we're having with Seam. It seems that the IceUserObject loaded by the EJB in one classloader doesn't agree with the class loaded by the renderkit, which uses a different classloader.  

If this was accurate, we couldn't pass objects between layers/servers because the classes wouldn't agree based on different classloaders.

Maybe the issue is that the JAR they have in the renderkit doesn't match the JAR I have in the EJB layer.

Any input?
[Email]
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2672
Offline


cmaclachlan - What are the specific exceptions you're receiving? Do they refer to any specific class?

John - Thanks for that Seam thread link. There's a lot of good commentary there. Have you tried to use the UseJBossWebLoader configuration setting? If you haven't already seen itThere's a post about this in our forums here and in the JBoss Seam forums here, where Gavin King suggests it. This seems to clear up some of our Seam-specific classloading issues, not sure if it fixes the tree one.

Thanks,
Philip

.
cmaclachlan

Joined: 15/08/2006 00:00:00
Messages: 3
Offline


Philip,

One change to my original post is that I am using JBoss 4.0.4 not 4.0.5.

My goal was to get an Icefaces war working within an ear with UseJBossWebLoader set to true (because I have a "legacy" application that has to be deployed that way).

So I added the showcase.war to one of our existing application ears. Showcase deployed fine and ran fine within the ear until I changed UseJBossWebLoader from false to true.

The following documents the problems I had and the things I tried:

With no changes except changing UseJBossWebLoader from false to true, I got:

13:31:39,970 ERROR [Digester] Digester.getParser:
java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
at org.apache.tomcat.util.digester.Digester.getFactory(Digester.java:486)
at org.apache.tomcat.util.digester.Digester.getParser(Digester.java:691)
at org.apache.tomcat.util.digester.Digester.getXMLReader(Digester.java:899)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)

No worries ... I kind of expected this one. I removed all the jars from the WEB-INF/lib that would be loaded by other classloaders and got the following error:
...
12:14:01,471 INFO [D2DViewHandler]
ICEsoft Technologies, Inc.
ICEfaces 1.5.1
Build number: 5
Revision: 12374

12:14:02,378 ERROR [[/aims]] StandardWrapper.Throwable
java.lang.IllegalStateException: No Factories configured for this Application. This happens if the f
aces-initialization does not work at all - make sure that you properly include all configuration set
tings necessary for a basic faces application and that all the necessary libs are included. Also che
ck the logging output of your web application and your container for any exceptions!
If you did that and find nothing, the mistake might be due to the fact that you use some special web
-containers which do not support registering context-listeners via TLD files and a context listener
is not setup in your web.xml.
A typical config looks like this;
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:90)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:88)

...

No worries ... I have seen this one before and there are lots of forum entries on how to fix it:

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=94248

Do not deploy the Myfaces jars in the WEB-INF/lib directory, they are already present in the tomcat deploy
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossWithIntegratedMyFaces

Classloader wiki
http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration

Must add tomahawk-1.1.3.jar to \deploy\jbossweb-tomcat55.sar\jsf-libs and configure
\deploy\jbossweb-tomcat55.sar\conf/web.xml


Ok, I am not using tomahawk, I am using Icefaces. So I added ice-faces.jar and icefaces-comps.jar to tomcat55.sar\jsf-libs and configured tomcat55.sar\conf\web.xml

<init-param>
<description>IceFaces tlds</description>
<param-name>tagLibJar1</param-name>
<param-value>jsf-libs/icefaces.jar</param-value>
</init-param>

I got the following errors:
12:43:18,469 INFO [D2DViewHandler]
ICEsoft Technologies, Inc.
ICEfaces 1.5.1
Build number: 5
Revision: 12374

12:43:18,469 ERROR [STDERR] java.lang.ClassCastException: com.icesoft.faces.application.D2DViewHandler
12:43:18,860 ERROR [STDERR] at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:560)
...

... the cycle continues ... I am sure that it is just a matter of getting the right jars in the right places. So far I have not found the "sweet spot", that's where I was hoping for some help.

Thanks.

Charlie
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2672
Offline


Hi Charlie,

Yikes. Quite the classloading saga;) I think there still might be a conflict between the Sun RI jars and the MyFaces jars. Even though you put the MyFaces jars in the Tomcat jsflibs dir, the Sun RI are still trying to load, as you can tell from the " 12:43:18,860 ERROR [STDERR] at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:560)". I would make sure that you don't have the Sun RI jars anywhere else on the classpath.

Thanks,
Philip

.
cmaclachlan

Joined: 15/08/2006 00:00:00
Messages: 3
Offline


Philip,

I am just back from vacation.

Thanks for your suggestion of removing the Sun RI jars but that did not solve the problem either. I did however get things working; I am now able to deploy an ear with a 1.1.5 Icefaces .war (showcase.war) in JBoss 4.0.5 and use the JBoss Web Loader. Basically I just reinstalled JBoss 4.0.5 with an EJB 3 configuration, created an ear that contained the showcase.war and deployed it … volia … it all worked. So why did I have so much trouble before? I am not quite sure but from posts I have read I was not the only one.

Here are some of the things I learned:

There is no need to pass the ice-faces.jar as an init parameter to the JspServlet in the tomcat55.sar/conf/web.xml. I had tried passing the ice-faces.jar as an init parameter to the JspServlet because that is what I do with tomahawk.

Do not put the ice-faces jars in the tomcat55.sar/jsf-lib; I didn’t have to touch this directory after reinstalling of JBoss 4.0.5. When using tomahawk I do put the tomahawk.jar in the jsf-lib directory but with an Icefaces implementation this does not seem to be the case.

The following jars should be in the war’s WEB-INF/lib:
el-api.jar
el-ri.jar
icefaces.jar
icefaces-comps.jar

Thanks for all your help.

Charlie

philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2672
Offline


Hi Charlie,

Glad to hear you got that sorted out. We seem to have more JSF classloading issues with JBoss 4.0.5 than we did with 4.0.4. We'll try to come out with some guidelines that will help. And we'll definitely take your suggestions.

Thanks again,
Philip

.
 
Forum Index -> JBoss Seam Integration
Go to:   
Powered by JForum 2.1.7ice © JForum Team