0

I have an ear which contains a war. Jars are in the ear lib directory.

I need to override a class from a jar and I wrote it in the war.

But when I deploy the ear, the classloader takes the class from the jar and not from the war.

I set this configuration in the jboss-web.xml in the war. I believe it forces the classloader to take classes from war before jar but it doesn't work.

<class-loading java2ClassLoadingCompliance="false">
    <loader-repository>
        com.example:archive=unique-archive-name
    <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
    </loader-repository>
</class-loading>

How can I force the jboss classloader to take classes from war before the jar ?

Thanks.

Jon Onstott
  • 13,499
  • 16
  • 80
  • 133
Kiva
  • 9,193
  • 17
  • 62
  • 94

1 Answers1

0

It seems that the jboss-web.xml configuration of the war is ignored when it is embedded in an ear (see http://www.openscope.net/2010/07/15/setting-up-a-jboss-instance-v5-x-class-loading/).
Have you tried to use jboss-classloading.xml files and to add the top-level-classloader attribute in the war (see http://phytodata.wordpress.com/2010/10/21/demystifying-the-jboss5-jboss-classloading-xml-file/)?

Michael_S
  • 196
  • 2
  • 9