当前位置: 代码迷 >> J2EE >> wsdl转成java 客户端出错解决方案
  详细解决方案

wsdl转成java 客户端出错解决方案

热度:69   发布时间:2016-04-22 02:14:08.0
wsdl转成java 客户端出错
C:\Documents and Settings\Administrator>d:

D:\Workspaces\CallWebservice>cd D:\Workspaces\CallWebservice

D:\Workspaces\CallWebservice>wsimport -d ./bin -s ./src -p com.yongan.client htt
p://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?WSDL
parsing WSDL...


Exception in thread "main" java.lang.NoSuchMethodError: com.sun.xml.internal.bin
d.v2.runtime.JAXBContextImpl.<init>([Ljava/lang/Class;Ljava/util/Collection;Ljav
a/util/Map;Ljava/lang/String;ZLcom/sun/xml/internal/bind/v2/model/annotation/Run
timeAnnotationReader;ZZ)V
  at com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BindInfo.getJAXB
Context(BindInfo.java:316)
  at com.sun.tools.internal.xjc.reader.internalizer.SCDBasedBindingSet.app
ly(SCDBasedBindingSet.java:195)
  at com.sun.tools.internal.xjc.ModelLoader.createXSOM(ModelLoader.java:50
2)
  at com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl.bind(Schem
aCompilerImpl.java:216)
  at com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl.bind(Schem
aCompilerImpl.java:69)
  at com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.bin
d(JAXBModelBuilder.java:120)
  at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAX
BModel(WSDLModeler.java:2173)
  at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internal
BuildModel(WSDLModeler.java:173)
  at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildMod
el(WSDLModeler.java:119)
  at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.jav
a:170)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:100)
  at com.sun.tools.internal.ws.WsImport.main(WsImport.java:38)

D:\Workspaces\CallWebservice>


wsdl 转成java 客户端代码为什么会这样?

------解决方案--------------------
java.lang.NoSuchMethodError 配置没问题?应该是你的环境变量的配置有问题吧,找不到该方法com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl
  相关解决方案