i use a third part lib from a partner company. I write a very small test client (3 lines) for it and it runs perfect with Java 7 but when i use Java 6 (in my finish version i must use java 6) it doesnt work. (https://jaxb.java.net/guide/Which_JAXB_RI_is_included_in_which_JDK_.html) (JDK6 use JAXB RI 2.1.10 JDK7 use JAXB RI 2.2.4-1)
I get an exception from the intern third lib implement exception. Looks like:
Exception in thread "main" javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:83)
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:244)
at com.sun.tools.internal.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:229)
at com.sun.tools.internal.ws.wscompile.WsgenTool.run(WsgenTool.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:105)
at com.sun.tools.internal.ws.WsGen.main(WsGen.java:41)
Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
java.lang.StackTraceElement does not have a no-arg default constructor.
this problem is related to the following location:
at java.lang.StackTraceElement
at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
at java.lang.Throwable
at java.lang.Exception...
The Problem is the intern implemented xyException. JAXB can't handle this StackTraceElement with no constructor.
I try to override the exception class completly with stacktrace methods on transient and try to set the it on classloader first but it doesnt work for me. (My class was use but same exception)
I read these topics for it:
https://www.java.net/node/698291
Why does JAXB need a no arg constructor for marshalling?
Unable to create JAXBContext creating my wsdl
https://java.net/jira/browse/JAXB-814
But i dont find a good solution for the problem in a third part lib. Can someone help me here please...
Thanks for your time.
Edit: All JAX-WS and JAXB methods and uses are inside the third party lib.