[jboss-user] [JBoss Microcontainer] - Re: How to stop my WAR loading JBoss's provided 3rd party classes?

Ales Justin do-not-reply at jboss.com
Tue Jan 4 16:16:49 EST 2011


Ales Justin [http://community.jboss.org/people/alesj] created the discussion

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

To view the discussion, visit: http://community.jboss.org/message/578817#578817

--------------------------------------------------------------
> > Here's the relevant section of my project's pom.xml:
> > 
> > > <dependency>
> > >    <groupId>org.hibernate</groupId>
> > >    <artifactId>hibernate-entitymanager</artifactId>
> > >    <version>3.6.0.Final</version>
> > >    <exclusions>
> > >     <exclusion>
> > > <groupId>javax.transaction</groupId>
> > >  <artifactId>jta</artifactId>
> > >  </exclusion>
> > > </exclusions>
> > > </dependency>
> > > 
> > 
> > I have also tried changing the scope of hibernate-entitymanager to "provided*"*, in which case my project should be using JBoss 6's provided hibernate libraries, but when I do that I get this exception:
> > 
> > > Caused by: java.lang.IncompatibleClassChangeError: Class org.hibernate.ejb.HibernatePersistence does not implement the requested interface javax.persistence.spi.PersistenceProvider
> > >  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225) [:3.0.5.RELEASE]
> > >  at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308) [:3.0.5.RELEASE]
> > >  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) [:3.0.5.RELEASE]
> > 
> Hmmm, how can this happen if both you and JBossAS use the same Hibernate version?
This would mean that somehow JPA slips into your project, hence those JPA classes get used -- as by the servlet spec.
Otoh, JBoss' Hibernate of course doesn't use those JPA classes, but its own.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/578817#578817]

Start a new discussion in JBoss Microcontainer at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2114]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110104/96a73ab2/attachment.html 


More information about the jboss-user mailing list