我正在尝试在 Tomcat 上运行 CXF WebService。部署 WAR 文件时,出现以下错误:
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:354)
at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:469)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:693)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:529)
at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:262)
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.ServerFactoryBean.create(ServerFactoryBean.java:168)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:460)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:338)
... 36 more
Caused by: javax.xml.bind.JAXBException
- with linked exception:
[com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://logicalprovisioning.gtt.com/gtc/processorder}objectFactory". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.gtt.logicalprovisioning.gtc.processorder.ObjectFactory
this problem is related to the following location:
at com.gtt.logicalprovisioning.utilities.symboltabledata.ObjectFactory
Two classes have the same XML type name "{http://logicalprovisioning.gtt.com/gtc/processorder}objectFactory". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.gtt.logicalprovisioning.utilities.symboltabledata.ObjectFactory
this problem is related to the following location:
at com.gtt.cio.commonheader.v3.ObjectFactory
]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:226)
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:345)
at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:343)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:343)
at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:245)
at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:497)
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:352)
... 47 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://logicalprovisioning.gtt.com/gtc/processorder}objectFactory". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.gtt.logicalprovisioning.gtc.processorder.ObjectFactory
this problem is related to the following location:
at com.gtt.logicalprovisioning.utilities.symboltabledata.ObjectFactory
Two classes have the same XML type name "{http://logicalprovisioning.gtt.com/gtc/processorder}objectFactory". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.gtt.logicalprovisioning.utilities.symboltabledata.ObjectFactory
this problem is related to the following location:
at com.gtt.cio.commonheader.v3.ObjectFactory
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:76)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:441)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:273)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:109)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1126)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:135)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
我使用 CXF 插件从 WSDL/XSD 生成 JAVA 类。这段代码在我使用 JDK8 时可以使用,但我最近将笔记本电脑移到了 JDK15。代码保持不变 6 个月。我想知道JDK的变化是否与它有关。但我想让它在 JDK15 上工作。任何的意见都将会有帮助。如果您需要更多信息,请告诉我。