我有两个 Maven JAXB 项目。
A:主要 Maven JAXB 存根 XSD 项目,其中包含 BASKET.xsd
B:Maven JAXB 存根想要将 BASKET.xsd 包装在自己的对象中的用户项目。
这会产生两个对象工厂(不同的包),两者都声明以下内容......
@XmlElementDecl(namespace = "http://www.bob.org/bob/namespace/", name = "Basket")
public JAXBElement<BasketType> createBasket(BasketType value) {
return new JAXBElement<BasketType>(QNAME, BasketType.class, null, value);
}
这一代是通过这个插件完成的......
org.jvnet.jaxb2.maven2
maven-jaxb2-插件
0.13.2
在应用程序启动时,我收到 CXF-RT-Frotnend-JaxRS 3.1.11 给我一个错误...
017-07-03 14:38:54,613845801: WARN : [RMI TCP Connection(3)-127.0.0.1] [] org.apache.cxf.jaxrs.utils.ResourceUtils: No JAXB context can be created
com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
The element name {http://www.bob.org/bob/namespace/}Basket has more than one mapping.
this problem is related to the following location:
at public javax.xml.bind.JAXBElement com.bob.bean.ObjectFactory.createBasket(org.bob.BasketType)
at com.bob.bean.ObjectFactory
this problem is related to the following location:
at public javax.xml.bind.JAXBElement org.userservice.bean.ObjectFactory.createBasket(org.bob.BasketType)
这不是我从 CXF 2.7.7 升级到 3.1.11 之前遇到的错误
有谁知道是否有办法让 maven-jaxb2-plugin 不在 UserService ObjectFactory 上生成方法 createBasket(..) ?
或者让 CXF 接受两个 ObjectFactoty 类上的两个相同的方法?