Tomcat服务器上的JAX-WS

我正在尝试在Tomcat服务器上部署JAX-

WS。我浏览了网上,并按照我在此处和此处找到的说明进行了操作,但无济于事。我收到以下错误,并且不知道如何解决此问题。

SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException

at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:103)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)

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 org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)

at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)

at org.apache.commons.digester.Rule.end(Rule.java:276)

at org.apache.commons.digester.Digester.endElement(Digester.java:1058)

at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)

at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)

at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at org.apache.commons.digester.Digester.parse(Digester.java:1567)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)

at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)

at org.apache.catalina.core.StandardService.start(StandardService.java:480)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

-错误的listenerStart-由于先前的错误导致上下文启动失败2011年6月30日,上午10:04:25 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed INFO:WSSERVLET13:JAX-WS上下文侦听器被破坏

这是我的sun-jaxws.xml文件

<?xml version="1.0" encoding="UTF-8"?>  <endpoints xmlns="http://java.sun.com/xml.ns/jax-ws/ri/runtime" version="2.0">

<endpoint name="ActionMutatorProxy" implementation="com.hyr.boa.transport.ActionMutatorProxy" url-pattern="/action_mutator_proxy" />

回答:

NoClassDefFoundError在部署时装置抛出一个类定义

存在于构建路径上(例如Java代码编译)不能在运行时被发现。编译时类路径与Tomcat(和其他容器)的部署时类路径不同。

您需要jaxp-api.jar输入WEB-INF/lib$CATALINA_HOME/lib

以上是 Tomcat服务器上的JAX-WS 的全部内容, 来源链接: utcz.com/qa/397957.html

回到顶部