我的网络服务无法与tomcat和axis2一起使用

时间:2018-08-25 08:13:45

标签: java apache web-services tomcat axis2

首先,英语不是我的母语,所以如果有一些错误,您可以编辑我的帖子。

问题:我创建了一个简单的代码,我想要的是在服务器上运行它。因此,我将知道Web服务器的外观。

public class OperatorClass {

    public int sum(int a , int b) {
        return a+b;
    }

}

我已经创建了所需的所有文件夹/类/软件包。

以下是屏幕截图,因此您可以看到:

https://i.gyazo.com/2971a09e9bca2e8e5f221fbfc72c2ab8.png

但是当我单击在服务器上运行此代码时,它显示为HTTP Status 404 – Not Found

我已经切换了服务器的位置,并且还单击了属性上的“使用tomcat安装”单选按钮。但是什么都没有改变。

我找到的一种解决方案是右键单击该项目,然后说“运行服务器”

当我这样做时,我得到的是这个屏幕,而不是404-Not Found错误:

https://i.gyazo.com/bf2230e2a3dd395701a430dc971cdea7.png

但是在单击图像中的链接之一后,出现了另一个错误。例如,当我单击“服务”时,我得到了:

  
    

HTTP状态500 –内部服务器错误

  
     

类型异常报告

     

Servlet [AxisServlet]的消息Servlet.init()抛出异常

     

说明服务器遇到意外情况,   阻止它满足请求。

     

Exception javax.servlet.ServletException:Servlet的Servlet.init()   [AxisServlet]抛出异常     org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)     org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)     org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)     org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)     org.apache.coyote.AbstractProtocol $ ConnectionHandler.process(AbstractProtocol.java:770)     org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1415)     org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)     java.base / java.util.concurrent.ThreadPoolExecutor.runWorker(未知   资源)     java.base / java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知   资源)     org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)     java.base / java.lang.Thread.run(未知来源)

     

根本原因java.lang.NoClassDefFoundError:   org / apache / ws / commons / schema / resolver / URIResolver     org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128)     org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149)     org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585)     org.apache.axis2.deployment.RepositoryListener.init(RepositoryListener.java:264)     org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:66)     org.apache.axis2.deployment.RepositoryListener。(RepositoryListener.java:61)     org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:152)     org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:233)     org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)     org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:620)     org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:471)     org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)     org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)     org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)     org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)     org.apache.coyote.AbstractProtocol $ ConnectionHandler.process(AbstractProtocol.java:770)     org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1415)     org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)     java.base / java.util.concurrent.ThreadPoolExecutor.runWorker(未知   资源)     java.base / java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知   资源)     org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)     java.base / java.lang.Thread.run(未知来源)

     

根本原因java.lang.ClassNotFoundException:   org.apache.ws.commons.schema.resolver.URIResolver     org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1309)     org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1138)     org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128)     org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149)     org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585)     org.apache.axis2.deployment.RepositoryListener.init(RepositoryListener.java:264)     org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:66)     org.apache.axis2.deployment.RepositoryListener。(RepositoryListener.java:61)     org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:152)     org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:233)     org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)     org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:620)     org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:471)     org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)     org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)     org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)     org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)     org.apache.coyote.AbstractProtocol $ ConnectionHandler.process(AbstractProtocol.java:770)     org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1415)     org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)     java.base / java.util.concurrent.ThreadPoolExecutor.runWorker(未知   资源)     java.base / java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知   资源)     org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)     java.base / java.lang.Thread.run(未知来源)

     

注意服务器中提供了根本原因的完整堆栈跟踪   日志。

我该如何解决这些家伙?我真的是这个东西的初学者,但是我遵循了youtube上的教程,但是我无法完成这项工作。

1 个答案:

答案 0 :(得分:0)

关于您的错误,明确指出未发现类异常。 Reference_1Tutorial_Reference这会有所帮助。如果提供更多使用的代码,可能会有所帮助。干杯。