cxf 2.7.1部署在TOMCAT抛javax.xml.bind.UnmarshalException异常
?
关键:
cxf-services-ws-discovery-api-2.7.1.jar
cxf-services-ws-discovery-service-2.7.1.jar
?
起因:
?
我cxf实现的webservice放到tomcat,启动完成后?,服务端总抛?javax.xml.bind.UnmarshalException:?意外的元素?(uri:"http://schemas.xmlsoap.org/ws/2005/04/discovery",?local:"Resolve")。所需元素为<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}AppSequence>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Bye>,<{http://www.w3.org/2005/08/addressing}EndpointReference>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Hello>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}MetadataVersion>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Probe>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ProbeMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Resolve>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ResolveMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Scopes>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Security>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Sig>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}SupportedMatchingRules>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Types>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}XAddrs>
at?com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)
at?com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258)
at?com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253)
at?com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:120)??异常。
?
经过:
?
解决步骤一:我查了挺多资料说是服务端的接口参数没写,但是我写了,还是有问题,试过了几种方式,还是抛这个异常。
?
解决步骤二:同样的项目,小惠用就没问题。后来我想肯那个是我本地的USER Library里的JAR包有问题。删了之后发现好用。
?
解决步骤三:第二天发现又不好用了。也许是我改了什么吧。不过感觉还是JAR包的问题。后来请教段老师,?发现确实是JAR包的问题。
?
结果:
??? 删除下面两个JAR包,异常不存在了
cxf-services-ws-discovery-api-2.7.1.jar
cxf-services-ws-discovery-service-2.7.1.jar
?
?