org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Could not marshall type.
org.codehaus.xfire.fault.XFireFault: Could not marshall type.
at org.codehaus.xfire.jaxb2.JaxbType.writeObject(JaxbType.java:254)
at org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(AegisBindingProvider.java:200)
at org.codehaus.xfire.service.binding.AbstractBinding.writeParameter(AbstractBinding.java:273)
at org.codehaus.xfire.service.binding.WrappedBinding.writeMessage(WrappedBinding.java:89)
at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:80)
at org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpChannel.java:56)
at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.getByteArrayRequestEntity(CommonsHttpMessageSender.java:313)
at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpMessageSender.java:251)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:123)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy13.getCityHosCompensationCases(Unknown Source)
at myclass.webservice.SyndataClientUse.getCityHosCompensationCases(SyndataClientUse.java:113)
at myclass.service.background.compensationDate.CompensationData.compensationData(CompensationData.java:35)
at myclass.service.background.compensationDate.CompensationData.main(CompensationData.java:84)
Caused by: javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package myservice
at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:205)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:149)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:238)
at org.codehaus.xfire.jaxb2.JaxbType.getJAXBContext(JaxbType.java:294)
at org.codehaus.xfire.jaxb2.JaxbType.writeObject(JaxbType.java:218)
... 19 morewebservice接口新增了新方法,我在自己项目重新生成该接口,添加新的接口调用方法,但运行时出现这种错误,现在还没解决。

解决方案 »

  1.   

    http://www.cnblogs.com/stephencat/archive/2007/06/26/795651.html
    说的很明白。
      

  2.   

    我的是
    Caused by: javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package myservice他的是
    Caused by: javax.xml.bind.JAXBException: com.SomeDomain.SomeObject nor any of its super class is known to this context他的做法我都试了,所有方法都在,我怀疑是xfire包的问题,但具体原因和解决方法不知道
      

  3.   

     你的服务端增加了方法后更新了吗?
    Unable to locate jaxb.properties for package myservice
    这个错看意思应给是包的问题,首先确定存在,如果以上都不是,那么很可能就是你的包冲突了。
      

  4.   

     Unable to locate jaxb.properties for package myservice你的myservice包下面有jaxb.properties吗? 
      

  5.   

    终于返现问题原因了,是jaxb包冲突的问题。
    jaxb-api-1.0.jar
    jaxb-impl-1.0.5.jar

    jaxb-api-2.0.jar
    jaxb-impl-2.0.1.jar
    冲突,保留
    jaxb-api-2.0.jar
    jaxb-impl-2.0.1.jar
    就解决了