willcodejavaforfood
willcodejavaforfood

Reputation: 44053

JBoss Classloader Repository

Running JBoss 4.2.3.GA and trying to deploy a WAR that is using Spring/Hibernate/JPA. I'm getting ClassCastExceptions (quite a lot of different ones) so I'm trying to setup a Classloader Repository for my WAR.

This is my catalog.war/WEB-INF/jboss-web.xml file

<jboss-web>
    <loader-repository> 
        com.moo.catalog:loader=catalogLoader
    </loader-repository> 
</jboss-web>

Pretty sure it is not working as I can see:

11:25:48,181 INFO [STDOUT] 11:25:48,181 INFO [Version] Hibernate EntityManager 3.2.1.GA 11:25:48,197 INFO [STDOUT] 11:25:48,197 INFO [Version] Hibernate Annotations 3.2.1.GA 11:25:48,197 INFO [STDOUT] 11:25:48,197 INFO [Environment] Hibernate 3.2.4.sp1

and I have 3.5.1-Final bundled in my war.

I tried to find proof of it working in the logs, but cannot see anything. How do I tell if I have successfully setup a classloader repository? Is that even the correct configuration and the correct place?

Upvotes: 3

Views: 3750

Answers (1)

Steve Jackson
Steve Jackson

Reputation: 1330

Sorry I don't know where to look in the logs - but this link may help

Have you tried running it with your classloader isolated? It may be that you're picking up the hibernate versions from server lib. I think this will work for JBoss 4.2:

<jboss-web>
 <class-loading java2ClassLoadingCompliance="false">
  <loader-repository>
     com.moo.catalog:loader=catalogLoader
     <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
  </loader-repository>
 </class-loading>
</jboss-web>

More info here

Upvotes: 3

Related Questions