-
1. Re: Why application-A dosnt know class which located in Appl
peterj Nov 17, 2008 11:32 AM (in response to avihaimar)Which version of JBoss AS? I believe the classpath for a EAR changed between 4.2.x and 5.0. If you scan the JBossAS5 forum you will probably find a few discussions on this topic.
-
2. Re: Why application-A dosnt know class which located in Appl
avihaimar Nov 17, 2008 11:45 AM (in response to avihaimar)I use in JBoss 4.2
You told me that JBoss share all classes , but i think its true only for classes in the lib directory.
I run the following test:
1. ejb in the root of the ear call to a class which located in the root of the ear - failed. if i move the jar (utility jar) to the lib or add him to the ejb-manifest classpath it work.
2. ear - b call to a class which located in a jar in the root of ear-a - failed.
Dosnt JBoss has by default shared repository? -
3. Re: Why application-A dosnt know class which located in Appl
peterj Nov 17, 2008 12:16 PM (in response to avihaimar)Yes, by default JBossAS shares all classes globally, including classes defined in an EAR file located in the deploy directory.
Maybe I am misunderstanding something in your post regarding the placement of classes. Please run "jar -tf xxx.ear" for both of your EAR files and post the output. -
4. Re: Why application-A dosnt know class which located in Appl
avihaimar Nov 17, 2008 12:44 PM (in response to avihaimar)The structre of the ear is:
myear.ear:
ejb.jar
utility.jar
META-INF
a stateless ejb in the ejb.jar failed to load class from the utility.jar
Thank you -
5. Re: Why application-A dosnt know class which located in Appl
peterj Nov 17, 2008 1:06 PM (in response to avihaimar)What is in your meta-inf/application.xml file? If it does not mention utility.jar, that jar is not loaded automatically (whereas JARs in 'lib' are automatically loaded).
-
6. Re: Why application-A dosnt know class which located in Appl
avihaimar Nov 17, 2008 3:00 PM (in response to avihaimar)No.
i didnt add it to the application.xml
i know that if i will add it than it will work.
My question is why it dosnt work by default.
Dosnt the class loader suppose to share all classes?
Thank you -
7. Re: Why application-A dosnt know class which located in Appl
peterj Nov 17, 2008 3:37 PM (in response to avihaimar)This has to do with the Java EE spec and how EAR files are supposed to be handled. Only those JARs mentioned in application.xml or placed into xxx.ear/lib get loaded, thus only those classes are available.