JBoss Community

Re: How to stop my WAR loading JBoss's provided 3rd party classes?

created by Tom Muldoon in JBoss Microcontainer - View the full discussion

I’m afraid that I haven’t been able to get past the issue in which JBoss’s version of Hibernate (3.6) is used instead of my version of Hibernate (3.2.6) which is deployed in WEB-INF/lib as evidenced by the stack trace…

 

Caused by: java.lang.AbstractMethodError: org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.getSharedCacheMode()

Ljavax/persistence/SharedCacheMode;

        at org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo(LogHelper.java:39) [:3.6.0.Final]

        at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:516) [:3.6.0.Final]

        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73) [:3.6.0.Final]

        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224) [:2.5.5]

        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:291) [:2.5.5]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368) [:2.5.5]

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334) [:2.5.5]

        ... 165 more

 

Here's the log entry proving that my WEB-INF/jboss-classloading-domain.xml file is being referenced (as expected)...

 

08:28:55,575 DEBUG [org.jboss.classloader.spi.ClassLoaderSystem] DefaultClassLoaderSystem@39452f registered domain=ClassLoaderDomain@182e645{name=FirstBest-UMS.war parentPolicy=(before=EXCLUDE [org.hibernate] after=<NOTHING>) parent=java.net.URLClassLoader@1112783}

 

 

My WEB-INF/jboss-classloading-domain.xml…

 

<?xml version="1.0" encoding="UTF-8"?>

<classloading-domain xmlns="urn:jboss:classloading-domain:1.0" name="FirstBest-UMS.war">

<parent-policy>

  <before-filter>

   <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.classloader.plugins.filter.NegatingClassFilter">

    <constructor>

     <parameter>

      <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.classloader.spi.filter.RecursivePackageClassFilter">

       <constructor>

        <parameter>org.hibernate</parameter>

       </constructor>

      </javabean>

     </parameter>

    </constructor>

   </javabean>

  </before-filter>

</parent-policy>

</classloading-domain>

 

This issue is unfortunately blocking our migration from JBoss 4.2.3 to JBoss 6.0.0.Final.

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community