0

我用 java 编写了一个使用 web 服务的程序,现在我正试图使用​​ eclipse、Axis 2 和 Tomcat7 将它放入另一个 web 服务中。

原始程序运行完美,所以我认为它应该在 web 服务中工作,虽然我不确定(我是 web 服务的新手)。我收到此部署异常:

   INFO: Ha comenzado la recarga de Contexto [/webService4]
[INFO] Clustering has been disabled
[INFO] Deploying module: addressing-1.6.2 - file:/Users/argelramirezreyes/Dropbox/java/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/webService4/WEB-INF/modules/addressing-1.6.2.mar
[INFO] Deploying module: metadataExchange-1.6.2 - file:/Users/argelramirezreyes/Dropbox/java/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/webService4/WEB-INF/modules/mex-1.6.2.mar
[INFO] Deploying module: mtompolicy-1.6.2 - file:/Users/argelramirezreyes/Dropbox/java/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/webService4/WEB-INF/modules/mtompolicy-1.6.2.mar
[INFO] Deploying module: ping-1.6.2 - file:/Users/argelramirezreyes/Dropbox/java/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/webService4/WEB-INF/modules/ping-1.6.2.mar
[INFO] Deploying module: script-1.6.2 - file:/Users/argelramirezreyes/Dropbox/java/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/webService4/WEB-INF/modules/scripting-1.6.2.mar
[INFO] Deploying module: soapmonitor-1.6.2 - file:/Users/argelramirezreyes/Dropbox/java/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/webService4/WEB-INF/modules/soapmonitor-1.6.2.mar
[INFO] Deploying JAXWS annotated class SolicitarFactura as a service - SolicitarFacturaService
[INFO] The SolicitarFactura service, which is not valid, caused java.lang.NoClassDefFoundError: javax/ws/rs/Produces
at org.apache.axis2.jaxrs.JAXRSUtils.getClassModel(JAXRSUtils.java:53)
at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.generateSchema(DefaultSchemaGenerator.java:272)
at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:468)
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:388)
at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:101)
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:178)
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:82)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:813)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:142)
at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:283)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:95)
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454)
at org.apache.axis2.webapp.AxisAdminServlet.init(AxisAdminServlet.java:60)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3926)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:426)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.Produces
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
... 32 more

[INFO] org.apache.axis2.deployment.DeploymentException: java.lang.NoClassDefFoundError: javax/ws/rs/Produces
[INFO] Deploying Web service: version.aar - file:/Users/argelramirezreyes/Dropbox/java/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/webService4/WEB-INF/services/version.aar
[WARN] No transportReceiver for org.apache.axis2.transport.http.AxisServletListener found.    An instance for HTTP will be configured automatically. Please update your axis2.xml file!
mar 26, 2013 7:45:52 PM org.apache.catalina.core.StandardContext reload
INFO: Se ha completado la recarga de este Contexto

我试图手动下载一个包含 javax.ws.rs.Produces 并导入的 jar,但问题仍然存在......

你可以帮帮我吗?

提前致谢。

4

1 回答 1

0

您需要将该特定 jar 保存在 lib 文件夹中。问题是在运行时,服务器无法识别特定的库。

于 2013-03-27T17:52:05.433 回答