I'm having an Arquillian test. The subject is an EJB that uses Hibernate 3, which I add to the shrinkwrapped archives along with all other Maven dependencies. It deploys the EJB as a JAR wrapped in an EAR, to an embedded JBOSS 7 which has Hibernate 4 on board. It clashes with the following exception:
java.lang.AbstractMethodError: org/hibernate/usertype/UserType.nullSafeSet(
Ljava/sql/PreparedStatement;Ljava/lang/Object;
ILorg/hibernate/engine/spi/SessionImplementor;)V
I strongly believe that my code (compiled against Hibernate 3) is executed against Hibernate 4, hence the error. JBOSS does parent first by default is my understanding, that would explain the error. I print out the archive contents as part of shrinkwrapping, so I believe I know Hibernate 3 is in the EAR.
I've tried changing JBOSS to parent last, but had no success at that. Some of these may be stupid, but I tried them anyway:
Added a META-INF/jboss-classloading.xml
(to the JAR and the EAR)
Added a META-INF/jboss-deployment-structure.xml
(to the JAR and the EAR) in attempt to exclude the parent Hibernate:
Delete the Hibernate JARs from JBOSS - that broke the server altogether
Following are a few configuration aspects of my setup:
- Dependencies:
org.hibernate:hibernate-annotations:jar:3.4.0.GA:provided
org.hibernate:hibernate-core:jar:3.3.2.GA:provided
org.jboss.arquillian.junit:arquillian-junit-container:jar:1.1.1.Final:test
org.jboss.arquillian.protocol:arquillian-protocol-servlet:jar:1.1.1.Final:test
org.jboss.as:jboss-as-arquillian-container-managed:jar:7.1.1.Final:provided
org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:jar:2.0.0:test
org.jboss.spec:jboss-javaee-web-6.0:pom:3.0.0.Final:provided
- Pointing to an unpacked
jboss-as-7.1.1.Final
META-INF/arquillian.xml
:
<arquillian ...>
<defaultProtocol type="Servlet 3.0" />
<container qualifier="jbossas-managed" default="true">
<configuration>
...
</configuration>
</container>
</arquillian>
META-INF/application.xml
:
<application ...
version="5">
<module><ejb>test.jar</ejb></module>
</application>
Anything else? :)
Your help much appreciated!