3

创建了一个 Web 服务,它使用 jax-ws 2.2、tomcat-6.0、jdk 1.6 返回 netbeans 7.3 中的自定义对象列表 - 从客户端调用此服务时会出现此异常 -

java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
com.sun.xml.ws.model.RuntimeModeler.processExceptions(RuntimeModeler.java:1213)
com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:943)
com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:711)
com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:472)
com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:314)
com.sun.xml.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:99)
com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:74)
com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:58)
com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:130)
com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:782)
com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:789)
com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:765)
com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:386)
com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:363)
com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:345)
javax.xml.ws.Service.getPort(Service.java:92)
service.StockDao_Service.getStockDaoPort(StockDao_Service.java:56)
org.apache.jsp.newjsp_jsp._jspService(newjsp_jsp.java:72)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

在对网络进行一些研究后发现我必须在 tomcat/lib 中创建背书文件夹并在 %CATALINA_HOME%/lib/endorsed 文件夹中复制 Web 服务 jar。在 win-7 上将全局 var CATALINA_HOME 设置为 tomcat 根目录并在 catalina home.prperties 中设置此路径后,我仍然收到此错误。我正在研究 Hadoop,所以我在 tomcat-6.0/lib 和 tomcat-6.0/lib/endorsed 文件夹中复制了所有 hadoop 和 jax-ws jar。

4

0 回答 0