xml类型冲突

y0u0uwnf  于 2021-07-06  发布在  Java
关注(0)|答案(0)|浏览(216)

我正在尝试在tomcat上运行cxfwebservice。部署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插件从wsdls/xsd生成java类。这段代码在我使用jdk8的时候很有用,但是最近我把笔记本电脑搬到了jdk15上。密码在6个月内未被修改。我想知道jdk的变化是否与此有关。但我想让它在jdk15上工作。任何建议都会有帮助。如果你需要更多的信息,请告诉我。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题