-
1. Re: the order of loading class (urgency! urgency! urgency! )
peterj Aug 15, 2008 11:10 AM (in response to zhengxi)When a JSP in a particular WAR uses the "a" class, it will get it from the A.jar that is in the same WAR.
In general, code within a WAR will use classes within that WAR (of course, if the class is not there it will look outside the WAR)), and code outside a WAR cannot use classes within the WAR. -
2. Re: the order of loading class (urgency! urgency! urgency! )
zhengxi Aug 16, 2008 12:48 AM (in response to zhengxi)I did some testing about this.
ear1.ear
|-war1.war
|-WEB-INF\A.jar(includes a.class)
|-test.jsp
war2.war
|-WEB-INF\A.jar(includes a.class)
ear1.ear, war1.war, war2.war use the same repository to share jars.
when test.jsp call a.class, jsp will use a.class in the war2.war, not the war1.war.
I don't know why, can i cannot understand it.
thanks. -
3. Re: the order of loading class (urgency! urgency! urgency! )
zhengxi Aug 16, 2008 12:49 AM (in response to zhengxi)ear1.ear
|-war1.war
|-WEB-INF\A.jar(includes a.class)
|-test.jsp
war2.war
|-WEB-INF\A.jar(includes a.class)
ear1.ear and war2.war are different file. -
4. Re: the order of loading class (urgency! urgency! urgency! )
peterj Aug 18, 2008 11:23 AM (in response to zhengxi)Which version of JBossAS are you using? In my testing, test.jsp uses a.class from A.jar in war1.war
-
5. Re: the order of loading class (urgency! urgency! urgency! )
zhengxi Aug 18, 2008 11:24 PM (in response to zhengxi)JBoss4.2.3
did you add this part to jboss-web.xml file?
<loader-repository>
test.classloader:loader=ear1.ear
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
And I found that test.jsp will use the A.jar that is in the application that is deployed firstly.
in this case, war2 will be deployed before ear1.ear, so it use a.class in war2.war.
if I modify the file org.jboss.deployment.MainDeployer-xmbean.xml in D:\jboss-4.2.3\server\default\conf\xmdesc,
==>
we let jboss deploy ear file firstly, then test.jsp will use a.class that is in the ear1.ear\war1.war\WEB-INF\A.jar -
6. Re: the order of loading class (urgency! urgency! urgency! )
zhengxi Aug 18, 2008 11:26 PM (in response to zhengxi)org.jboss.deployment.MainDeployer-xmbean.xml
value="250:.rar,300:-ds.xml,400:.jar,500:.war,550:.jse,650:.ear,800:.bsh"
==>
value="250:.rar,300:-ds.xml,400:.jar,450:.ear,500:.war,550:.jse,800:.bsh"