CXF客户端执行的奇怪问题

javaroom 发布于 2012/06/26 11:35
阅读 1K+
收藏 0

用CXF生成客户端,服务端是.net编写,代码未打包时执行,完全正确,但是打成jar包之后却不正常,异常信息如下: 

org.apache.cxf.service.factory.ServiceConstructionException
	at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:292)
	at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:438)
	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:682)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:501)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:241)
	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:202)
	at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
	at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)
	at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:152)
	at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
	at com.test.WSClientFactoryDX.getDXOrderProxyFactoryBean(WSClientFactoryDX.java:87)
	at com.test.Test.findOrders(Test.java:59)
	at com.test.Test.main(Test.java:216)
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
There's no ObjectFactory with an @XmlElementDecl for the element {urn:DX.OMS.Services.Model/2011/7}Discount.
	this problem is related to the following location:
		at protected java.util.List model.services.oms.dx._2011._7.AddSkuRequest.rest
		at model.services.oms.dx._2011._7.AddSkuRequest
		at @javax.xml.bind.annotation.XmlSeeAlso(value=[class model.services.oms.dx._2011._7.ChangeWrappingOptionsRequest, class model.services.oms.dx._2011._7.AddSkuRequest, class model.services.oms.dx._2011._7.ChangeShippingOptionsRequest, class model.services.oms.dx._2011._7.CancelOrderRequest, class model.services.oms.dx._2011._7.ChangePaymentOptionsRequest, class model.services.oms.dx._2011._7.ChangeSkuRequest, class model.services.oms.dx._2011._7.ChangeFulfillmentOptionsRequest, class model.services.oms.dx._2011._7.CompleteOrderRequest])
		at model.services.oms.dx._2011._7.ChangePaymentOptionsRequest
		at protected model.services.oms.dx._2011._7.ChangePaymentOptionsRequest services.oms.dx._2011._7.ChangePaymentOptions.request
		at services.oms.dx._2011._7.ChangePaymentOptions

	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 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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
	at org.apache.cxf.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:258)
	at org.apache.cxf.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:167)
	at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:418)
	at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:290)
	... 13 more

请问这是怎么回事?

加载中
返回顶部
顶部