[jboss-user] [Installation, Configuration & Deployment] - Why loading the class in EJB jar rather than the one in war
bennyckp
do-not-reply at jboss.com
Thu Jul 13 05:42:49 EDT 2006
Hi everyone,
This question is about the class loader config in JBoss.
I am currently deploying a EJB jar and a war in JBoss 4.0.3SP1.
They are mdb.jar and app.war and are placed in the server/default/deploy folder separately.
In the mdb.jar, I have a ClassA.class, i.e.
mdb
|_ ClassA.class (version 1)
|_ META-INF
In the app.war, I also have a ClassA.class but it contains some system out in this version, i.e.
app
|_ WEB-INF
| |_ classes
| |_ClassA.class (version 2 w/ system out)
|_ ...
When I startup my JBoss, I don't know why the web application uses the ClassA in the mdb.jar which has no system out?
My Question is:
1. Do the jar and the war share a common class loader ?
2. After I've read the doc about JBoss setting, I config the jboss-web.xml in the app.war as follow but the problem still exists.
<jboss-web>
| <class-loading java2ClassLoadingCompliance="false">
| <loader-repository>
| com.cherrypicks:loader=chs.war
| <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
| </loader-repository>
| </class-loading>
| </jboss-web>
Even though I redeploy the app.war, it still loads the ClassA in mdb.jar.
Can anybody explain it ?
My jboss tomcat setting is like below..
<attribute name="Java2ClassLoadingCompliance">false</attribute>
| <attribute name="UseJBossWebLoader">false</attribute>
3. I want different deployments use their own classes in jar/war and don't let them to use the classes (with same name) in other deployment, i.e. separate class loader. How can I do that ?
Thanks,
Benny Chan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957670#3957670
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957670
More information about the jboss-user
mailing list