gpt4 book ai didi

java - 在 Apache Tomcat 中将 JAX-WS Web 服务部署为 War

转载 作者:行者123 更新时间:2023-11-30 07:16:30 29 4
gpt4 key购买 nike

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

但我的问题是如何在 Apache 中部署一个 war 文件。每当我在服务器上运行时,它都会以异常结束 SEVERE: WSSERVLET11: failed to parse runtime descriptor: 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 publisher 运行它,它会起作用,

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'

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

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

提前致谢

最佳答案

我通过复制 JAX-WS 依赖项的文件 ha-api.jar 并将其粘贴到 $CATALINA_HOME\lib 中解决了这个问题

关于java - 在 Apache Tomcat 中将 JAX-WS Web 服务部署为 War,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16910836/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com