I am using javax.persistence.JoinColumn.foreignKey
in my code. The project is working fine using WildFly server, but when I use Jboss EAP 6.1, it gives below error:
java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey; org.hibernate.cfg.AnnotationBinder.bindManyToOne(AnnotationBinder.java:2884) org.hibernate.cfg.AnnotationBinder.bindOneToOne(AnnotationBinder.java:3051) org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1839) org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:963) org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:796)
When I further investigated the issue, I found that JBoss Library does not support Join columns.
However, my project library supports Join column and I intent to use these library in my code. But Jboos libraries seem to be overriding the libraries in the class path.
I tried below code in jboss-deployment-structure.xml
<exclusions>
<module name="javax.persistence.api"/>
<module name="javaee.api"/>
</exclusions>
But I am getting below error
11:19:55,195 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."myappl.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."myappl.war".PARSE: JBAS018733: Failed to process phase PARSE of deployment "myappl.war" Caused by: java.lang.IllegalStateException: JBWS021001: Unexpected element parsing handlers: handler-config