This content has been marked as final.
Show 6 replies
-
1. Re: Classloader problem ?
alesj Apr 9, 2009 2:46 AM (in response to fancoli)What's a webcontent folder?
-
2. Re: Classloader problem ?
fancoli Apr 9, 2009 3:01 AM (in response to fancoli)It is the war root folder
-
3. Re: Classloader problem ?
jaikiran Apr 9, 2009 3:06 AM (in response to fancoli)So you are trying to load a resource, which exists in a WAR from a EJB (jar)? The WAR by default has its own classloader and the resources in the WAR are not visible to other components by default.
As a workaround you can make the WAR use a common classloader, by setting the following property to true, in %JBOSS_HOME%/server/< serverName>/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml:<property name="useJBossWebLoader">true</property>
But remember that its just a workaround. If you want the resource.xml to be available outside the WAR, then you should change the packaging and move it to the root of the EAR. -
4. Re: Classloader problem ?
fancoli Apr 9, 2009 3:17 AM (in response to fancoli)Thanks Jaikiran,
yes this is what I am trying to do.
Is this an issue of the classloader of JBoss 5? On 4.2.2 release I have set useJBossWebLoader to false and all works.
max -
5. Re: Classloader problem ?
alesj Apr 9, 2009 4:14 AM (in response to fancoli)"jaikiran" wrote:
But remember that its just a workaround. If you want the resource.xml to be available outside the WAR, then you should change the packaging and move it to the root of the EAR.
Having resources in .ear's root is bad practice, since it's not by the spec. ;-)
- http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4195146#4195146 -
6. Re: Classloader problem ?
jaikiran Apr 9, 2009 4:20 AM (in response to fancoli)"alesj" wrote:
Having resources in .ear's root is bad practice, since it's not by the spec. ;-)
- http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4195146#4195146
Ah, yes I forgot that :)