Do you mean jboss/lib? I am not familiar w/ lib/ext. If you put JARs in both, make sure you use a scoped classloader in your EAR. Otherwise, I have seen the classloader complain with ClassNotFoundExceptions, when it actually finds more than one class. The only thing we put in lib are JARs that are *very* static over time, such as 'extra' 3rd party libs that all apps use (jakarta-commons, JDBC driver JARs, etc), and we don't generally package those in the EAR.
Mike, Thanks for the quick response. If I delete xercesImpl.jar, xml-apis.jar, xmlParserAPIs.jar,
and struts.jar from jboss\lib and deploy these files with my ear file the application
works fine. But I keep these files in jboss\lib and exclude in ear file the JBOSS
is giving following message.
This class file exists under jboss\tmp\deploy\Default\myapption.ear\web1002\WEB-INF\
classes\com\test\myapption.formbean. I'm not sure why I'm getting class not found
[13:41:48,430,STDOUT] JBoss-2.4.9 Started in 0m:49s.401
[13:42:31,913,Engine] action: Processing a POST for /Login
[13:42:31,953,Engine] action: Setting locale 'en_US'
[13:42:31,963,Engine] action: Looking for ActionForm bean under attribute 'loginForm'
[13:42:31,963,Engine] action: Creating new ActionForm instance of class 'com.test.myapption.formbean.LoginForm'
[13:42:31,973,Engine] action: Error creating ActionForm instance of class 'com.test.myapption.formbean.LoginForm'
java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean)
java.lang.Class java.lang.Class.forName0(java.lang.String, boolean, java.lang.ClassLoader)
Yes - I think this is something unique to Struts and the way it loads classes. I think the Struts action form class (the parent of your form) is found in multiple places, when the struts jar is in lib and in the EAR. If you need it in both places, use a scoped classloader in your EAR (jboss-app.xml), so you get no conflict.
Actually the problem is I don't want to include these jars in my ear file because these are common to all applications and should be in jboss\lib. If I do this my app is my *not* working. I tried having d:\jboss\jboss\lib\struts.jar in CLASSPATH. Didn't help either.
App works fine if I keep all my application classes including action classes in jboss\lib also. I know this is very bad idea to keep classes in multiple places. As you mentioned this could be scoping issue.
Here is the package and import statements from my formbean.
I don't have to use scoped classloader if I'm not having jars in ear as well as in jboss\lib, isn't it ? Could you please send me the syntax of scoped classloader in EAR for future reference.