Reputation: 23
I am trying to deploy my application and web service to weblogic using the following versions:
When I call my web service I get the error
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:Fault xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
<faultcode>ns2:Server</faultcode>
<faultstring>javax/persistence/OneToMany.orphanRemoval()Z</faultstring>
<detail>
<ns2:exception class="java.lang.NoSuchMethodError" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/">
<message>javax/persistence/OneToMany.orphanRemoval()Z</message>
<ns2:stackTrace>
<ns2:frame class="org.hibernate.cfg.AnnotationBinder" file="AnnotationBinder.java" line="1868" method="processElementAnnotations"/>
<ns2:frame class="org.hibernate.cfg.AnnotationBinder" file="AnnotationBinder.java" line="768" method="processIdPropertiesIfNotAlready"/>
...
I have checked and there is no other persistence api jars included.
My external jar list is:
I have checked these and the Hibernate JPA is the only one with the OneToMany class. I know the problem is a conflict between JPA 1.0 and JPA 2.0 so I just want to know if there is a way around the conflict.
Thanks
Upvotes: 2
Views: 16326
Reputation: 1094
WebLogic 10.3.5 can support JPA 2, but only after applying a patch as described in this page: (At least, this is how I got it to work for me.)
It boiled down to editing setDomainEnv.cmd
and adding javax.persistence_1.0.0.0_2-0-0.jar
and com.oracle.jpa2support_1.0.0.0_2-0.jar
to the PRE_CLASSPATH
environment variable.
For my Windows XP WebLogic installation I added these lines:
REM Add JARs for JPA 2.0 at the front of the class path.
set WLS_MODULES=%WL_HOME%\..\modules
set PRE_CLASSPATH=%WLS_MODULES%\javax.persistence_1.0.0.0_2-0-0.jar;%WLS_MODULES%\com.oracle.jpa2support_1.0.0.0_2-0.jar
Good Luck,
Randy
Upvotes: 4
Reputation: 9255
Do you have to use Hibernate JPA API 2.0?
As mentioned in WebLogic doc, WebLogic 10.3.5 seems to roughly support for only one JPA 2.0 provider, which is called TopLink.
Maybe you could just remove the hibernate-jpa-2.0-api-1.0.1.Final.jar
from your classpath and try use TopLink as described in the above mentioned WebLogic documentation.
I'll just give a little note given the docs: by default WebLogic 10.3.5 uses JPA 1.0 in order to maintain Java EE 5 compatibility. Since JPA 2.0 is part of Java EE 6, you have to explicitly enable it.
Upvotes: 1