3

我已经使用 JAXWS 开发了一个 web 服务,并且能够从 Tomcat 7 上的 eclipse 运行它而没有任何问题。

但我的问题是如何在 Apache 中部署它的战争文件。当我在服务器上运行时,它最终会出现异常严重:WSSERVLET11:无法解析运行时描述符:java.lang.NoClassDefFoundError:org/glassfish/ha/store/api/BackingStoreException

如果我登录到 Apache 并尝试从那里运行,我可以看到这个FAIL - Application at context path /IPWSv2 could not be started

这是我的 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="IPWSServiceV1" implementation="com.ipws.insurpay.ipwsv1.IPWSServiceV1"
    url-pattern="/IPWSServiceV1" />
</endpoints>

我的 web.xml 中有这个映射

 <servlet-mapping>
    <servlet-name>IPWSServiceV1</servlet-name>
    <url-pattern>/IPWSServiceV1</url-pattern>
</servlet-mapping>

如果我与 enpoint 发布者一起运行它,它就可以工作,

public static void main(String[] args) {
     Endpoint.publish("http://host/Project-Name/IPWSServiceV1",
             new IPWSServiceV1());

}

以下是堆栈跟踪:

   Jun 4, 2013 11:18:02 AM org.apache.catalina.core.StandardContext startInternal
 SEVERE: Context [/IPWSv2] startup failed due to previous errors
 Jun 4, 2013 11:18:07 AM org.apache.catalina.startup.HostConfig deployDirectory
 INFO: Deploying web application directory C:\Program Files\Apache Software       Foundation\Tomcat 7.0\webapps\docs
 Jun 4, 2013 11:18:07 AM org.apache.catalina.startup.HostConfig deployDirectory
 INFO: Deploying web application directory C:\Program Files\Apache Software   Foundation\Tomcat 7.0\webapps\manager
 Jun 4, 2013 11:18:08 AM org.apache.catalina.startup.HostConfig deployDirectory
 INFO: Deploying web application directory C:\Program Files\Apache Software   Foundation\Tomcat 7.0\webapps\ROOT
Jun 4, 2013 11:18:08 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 4, 2013 11:18:08 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 4, 2013 11:18:08 AM org.apache.catalina.startup.Catalina start
 INFO: Server startup in 7668 ms
 Jun 4, 2013 11:22:54 AM org.apache.catalina.core.ApplicationContext log
 INFO: HTMLManager: init: Associated with Deployer    'Catalina:type=Deployer,host=localhost'
 Jun 4, 2013 11:22:54 AM org.apache.catalina.core.ApplicationContext log
 INFO: HTMLManager: init: Global resources are available
 Jun 4, 2013 11:22:54 AM org.apache.catalina.core.ApplicationContext log
 INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
 Jun 4, 2013 11:22:56 AM org.apache.catalina.core.ApplicationContext log
 INFO: HTMLManager: start: Starting web application '/IPWSv2'
 Jun 4, 2013 11:22:57 AM com.sun.xml.ws.transport.http.servlet.WSServletContextListener    parseAdaptersAndCreateDelegate
SEVERE: WSSERVLET11: failed to parse runtime descriptor:     java.lang.NoClassDefFoundError: org/glassfish/ha/store/api/BackingStoreException
 java.lang.NoClassDefFoundError: org/glassfish/ha/store/api/BackingStoreException
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.<init>  (ServletAdapter.java:95)
at     com.sun.xml.ws.transport.http.servlet.ServletAdapterList.createHttpAdapter(ServletAdapterList.java:77)
at com.sun.xml.ws.transport.http.servlet.ServletAdapterList.createHttpAdapter(ServletAdapterList.java:53)
at com.sun.xml.ws.transport.http.HttpAdapterList.createAdapter(HttpAdapterList.java:77)
at com.sun.xml.ws.transport.http.HttpAdapterList.createAdapter(HttpAdapterList.java:71)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:266)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:152)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
at com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer.onStartup(WSServletContainerInitializer.java:65)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5274)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1256)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:714)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:219)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:193)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Caused by: java.lang.ClassNotFoundException:    org.glassfish.ha.store.api.BackingStoreException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 38 more
Jun 4, 2013 11:22:57 AM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/IPWSv2] startup failed due to previous errors
Jun 4, 2013 11:22:57 AM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'

我用谷歌搜索了这个,但找不到如何部署它。

任何机构都可以建议我解决这个问题吗?

提前致谢

4

2 回答 2

3

我通过复制ha-api.jarJAX-WS 依赖项文件并将其粘贴到$CATALINA_HOME\lib

于 2014-12-11T17:44:08.813 回答
1
  1. http://jax-ws.java.net/
  2. 下载 JAX-WS RI 发行版。
  3. 解压缩并将以下 JAX-WS 依赖项复制到 Tomcat 库文件夹“{$TOMCAT}/lib”:

    jaxb-impl.jar、jaxws-api.jar、jaxws-rt.jar、gmbal-api-only.jar、management-api.jar、stax-ex.jar、streambuffer.jar、policy.jar。

干杯!

于 2014-05-18T17:40:14.140 回答