Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenJDK 11: Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions #28

Open
robertklaus-bosch opened this issue Apr 9, 2019 · 1 comment

Comments

@robertklaus-bosch
Copy link

robertklaus-bosch commented Apr 9, 2019

With version 7.8.2 we encounter following problem:

Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
    at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check (IllegalAnnotationsException.java:102)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet (JAXBContextImpl.java:472)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init> (JAXBContextImpl.java:302)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build (JAXBContextImpl.java:1140)
    at com.sun.xml.bind.v2.ContextFactory.createContext (ContextFactory.java:154)
    at com.sun.xml.bind.v2.ContextFactory.createContext (ContextFactory.java:121)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at javax.xml.bind.ContextFinder.newInstance (ContextFinder.java:211)
    at javax.xml.bind.ContextFinder.find (ContextFinder.java:372)
    at javax.xml.bind.JAXBContext.newInstance (JAXBContext.java:574)
    at org.apache.cxf.common.jaxb.JAXBContextCache$2.run (JAXBContextCache.java:346)
    at org.apache.cxf.common.jaxb.JAXBContextCache$2.run (JAXBContextCache.java:344)
    at java.security.AccessController.doPrivileged (Native Method)
    at org.apache.cxf.common.jaxb.JAXBContextCache.createContext (JAXBContextCache.java:344)
    at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas (JAXBContextCache.java:246)
    at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas (JAXBDataBinding.java:498)
    at org.apache.cxf.jaxb.JAXBDataBinding.initialize (JAXBDataBinding.java:353)
    at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings (AbstractServiceFactoryBean.java:86)
    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass (ReflectionServiceFactoryBean.java:470)
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass (JaxWsServiceFactoryBean.java:693)
    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel (ReflectionServiceFactoryBean.java:530)
    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create (ReflectionServiceFactoryBean.java:263)
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create (JaxWsServiceFactoryBean.java:199)
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint (AbstractWSDLBasedEndpointFactory.java:103)
    at org.apache.cxf.frontend.ClientFactoryBean.create (ClientFactoryBean.java:91)
    at org.apache.cxf.frontend.ClientProxyFactoryBean.create (ClientProxyFactoryBean.java:159)
    at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create (JaxWsProxyFactoryBean.java:142)
    at com.blackducksoftware.sdk.protex.client.util.ProtexServerProxy.getPortFromUrl (ProtexServerProxy.java:1258)
    at com.blackducksoftware.sdk.protex.client.util.ProtexServerProxy.getApiInstance (ProtexServerProxy.java:1086)
    at com.blackducksoftware.sdk.protex.client.util.ProtexServerProxy.getProjectApi (ProtexServerProxy.java:670)
    at com.blackducksoftware.sdk.protex.client.util.ProtexServerProxy.getProjectApi (ProtexServerProxy.java:658)

Setting a breakpoint at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder#check reveals:

[Two classes have the same XML type name "{urn:protex.blackducksoftware.com:sdk:v7.0:project}getTags". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location: at com.blackducksoftware.sdk.protex.project.GetTags this problem is related to the following location: at com.blackducksoftware.sdk.protex.user.GetTags at public javax.xml.bind.JAXBElement com.blackducksoftware.sdk.protex.user.ObjectFactory.createGetTags(com.blackducksoftware.sdk.protex.user.GetTags) at com.blackducksoftware.sdk.protex.user.ObjectFactory, Two classes have the same XML type name "{urn:protex.blackducksoftware.com:sdk:v7.0:project}getTagsResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location: at com.blackducksoftware.sdk.protex.project.GetTagsResponse this problem is related to the following location: at com.blackducksoftware.sdk.protex.user.GetTagsResponse at public javax.xml.bind.JAXBElement com.blackducksoftware.sdk.protex.user.ObjectFactory.createGetTagsResponse(com.blackducksoftware.sdk.protex.user.GetTagsResponse) at com.blackducksoftware.sdk.protex.user.ObjectFactory]

I have no idea why this is happening with Java 11. Any ideas what to do here?

@ingoschaal
Copy link

ingoschaal commented Jul 9, 2019

Hi

we also have similar problems with java 11+ and the sdk-client-tools-protex
After we switched to java 11 and configured the dependencies accordingly,we get the error below.

We've added the following libraries to the classpath in build.gradle to replace the missing javax. * Classes that are no longer available in Java 12:

javax.jws:javax.jws-api:1.1
javax.xml.soap:javax.xml.soap-api:1.4.0
javax.xml.ws:jaxws-api:2.3.1
com.sun.activation:javax.activation:1.2.0
com.sun.xml.messaging.saaj:saaj-impl:1.5.1

Exception:
Caused by: javax.xml.ws.soap.SOAPFaultException: class com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to class javax.xml.soap.SOAPElement (com.sun.org.apache.xerces.internal.dom.ElementNSImpl is in module java.xml of loader 'bootstrap'; javax.xml.soap.SOAPElement is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @5e107136) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156) at com.sun.proxy.$Proxy120.getProjectByName(Unknown Source) at com.blackducksoftware.sdk.protex.project.ProjectApi$getProjectByName.call(Unknown Source)

StackTracke:
Interceptor for {urn:protex.blackducksoftware.com:sdk:v7.0:project}ProjectApiService#{urn:protex.blackducksoftware.com:sdk:v7.0:project}getProjectByName has thrown exception, unwinding now java.lang.ClassCastException: class com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to class javax.xml.soap.SOAPElement (com.sun.org.apache.xerces.internal.dom.ElementNSImpl is in module java.xml of loader 'bootstrap'; javax.xml.soap.SOAPElement is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @5e107136) at org.apache.cxf.binding.soap.saaj.SAAJStreamWriter.adjustOverlaidNode(SAAJStreamWriter.java:64) at org.apache.cxf.staxutils.OverlayW3CDOMStreamWriter.writeStartElement(OverlayW3CDOMStreamWriter.java:132) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:122) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:81) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:61) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:541) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) at com.sun.proxy.$Proxy120.getProjectByName(Unknown Source) at com.blackducksoftware.sdk.protex.project.ProjectApi$getProjectByName.call(Unknown Source)
Are There already activities to make sdk java 11+ compatible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants