0

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.

Community
  • 1
  • 1
pL4Gu33
  • 2,045
  • 16
  • 38
  • How does the library get the JAXB provider? You can try another one or even mess with the JRE distribution – Raffaele Aug 26 '15 at 20:57
  • It gets it from my JRE. (AFAIK) I try to override it in the classpath with a new implementation... nothing works. Best thing were a programmaticsolution not a lib chaos :) – pL4Gu33 Aug 27 '15 at 17:17
  • *Classpaht override*? Please, don't do it! Such a thing does not exist in Java. I suggested to manually add/remove JARs and classes from the JRE distribution (essentially, you'll end up with a custom build) – Raffaele Aug 27 '15 at 17:21
  • I mean with "classpath override" i load my JRE in order after my newer JAXB Implementation (Build Path -> Order & Export). But it doesnt work ;) .... okay thanks for your imformations :) I will try something in this direction. – pL4Gu33 Aug 27 '15 at 19:00

0 Answers0