title: Can't get my web-service to work with tomcat & axis2
body: <p>Firstly, english is not my native language so if there are some mistakes you can edit my post.</p>
  
  <p><strong>Question:</strong> I have created a simple code, what I want is running it on my server. So I will know what a web server will look like.</p>
  
  <pre><code>public class OperatorClass {
  
      public int sum(int a , int b) {
          return a+b;
      }
  
  }
  </code></pre>
  
  <p>I have created all the folders/classes/packages required.</p>
  
  <p>Here is a screenshot so you can see:</p>
  
  <p><a href="https://i.gyazo.com/2971a09e9bca2e8e5f221fbfc72c2ab8.png" rel="nofollow noreferrer">https://i.gyazo.com/2971a09e9bca2e8e5f221fbfc72c2ab8.png</a></p>
  
  <p>But when I click run this code on server, it says <code>HTTP Status 404 – Not Found</code></p>
  
  <p>I already switched the location of server, and also clicked the "use tomcat installation" radio button on properties. But nothing changed.</p>
  
  <p>One solution I find is right clicking on the project and then say "run-on server"</p>
  
  <p>When I do this, instead of 404-Not Found error, I'm getting this screen:</p>
  
  <p><a href="https://i.gyazo.com/bf2230e2a3dd395701a430dc971cdea7.png" rel="nofollow noreferrer">https://i.gyazo.com/bf2230e2a3dd395701a430dc971cdea7.png</a></p>
  
  <p>But after clicking one of the links in the image, I got another error. For example when I click "Services" I got this:</p>
  
  <blockquote>
    <blockquote>
      <p>HTTP Status 500 – Internal Server Error</p>
    </blockquote>
    
    <p>Type Exception Report</p>
    
    <p>Message Servlet.init() for servlet [AxisServlet] threw exception</p>
    
    <p>Description The server encountered an unexpected condition that
    prevented it from fulfilling the request.</p>
    
    <p>Exception javax.servlet.ServletException: Servlet.init() for servlet
    [AxisServlet] threw exception
      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(Unknown
    Source)
      java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
    Source)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.base/java.lang.Thread.run(Unknown Source)</p>
    
    <p>Root Cause 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(Unknown
    Source)
      java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
    Source)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.base/java.lang.Thread.run(Unknown Source)</p>
    
    <p>Root Cause 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(Unknown
    Source)
      java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
    Source)
      org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      java.base/java.lang.Thread.run(Unknown Source)</p>
    
    <p>Note The full stack trace of the root cause is available in the server
    logs.</p>
  </blockquote>
  
  <p>How can I fix this guys? I'm really beginner with this stuff but I followed the tutorials on youtube but I can't make this work.</p>