Etat HTTP 500 - “Servlet.init()”pour la servlet AxisServletgénéréuneexception

时间:2016-02-22 09:14:16

标签: java eclipse web-services tomcat web-applications

我在java中用eclips和apache-tomcat-8.0.32服务器和axis2-1.7.0写了一个简单的java程序 这是我的代码:

package services;
import java.io.IOException;
import java.io.IOException;
import java.net.Socket;
import simObject.control.Traitement_motion_sensor;
import simObject.sensor.Motion_sensor;
import listener_Thread.Motion_sensor_listener;
import grid.Position;
import grid.Grid;
public class SW_motion_senssor 
{
    public Traitement_motion_sensor traitement_motion_sensor;
    public Socket s;
    private int id_motion_sensor ;
    public Motion_sensor_listener ecout_mos;    
    private int motion_exist;
    private int port_motion_sensor;
    public Motion_sensor m;
    private int orientation;
    boolean running =true;
    public Grid g;
    public Position p;
    public SW_motion_senssor() throws IOException  
    {
        m=new Motion_sensor(p,g,porte);
    }
    }
        public int Get_existe()
    {
        return m.getMotion_exist();
    }
    public Position Get_position()
    {
        return m.getPosition();

    }

}`

当我执行它时,发生以下错误:

Etat HTTP 500 - "Servlet.init()" pour la servlet AxisServlet a généré une exception

type Rapport d''exception

message "Servlet.init()" pour la servlet AxisServlet a généré une exception

description Le serveur a rencontré une erreur interne qui l''a empêché de satisfaire la requête.

exception

javax.servlet.ServletException: "Servlet.init()" pour la servlet AxisServlet a généré une exception
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:744)
cause mère

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:144)
    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.<init>(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:502)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:744)
cause mère

java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1308)
    org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1142)
    org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128)
    org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:144)
    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.<init>(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:502)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:744)
note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/8.0.32.

3 个答案:

答案 0 :(得分:2)

对于上面的注释延续,将xmlschema-core-2.2.1放在Tomcat lib或您正在使用的服务器库中...它对我有用...

答案 1 :(得分:1)

在Axis2 1.7.0中,Apache XmlSchema依赖关系已从1.4.x更新为2.x(这是一个重大变化)。可能Eclipse工具尚未更新以考虑到这一点,您仍然拥有XmlSchema 1.4.x(或完全缺少依赖项)。

您需要将以下JAR添加到您的应用程序中:

http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.apache.ws.xmlschema%20a%3Axmlschema-core

答案 2 :(得分:0)

这些是您在日志中收到的错误:

java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/resolver/URIResolver java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver

您缺少环境中的XmlSchema jar。请拿到这个罐子再试一次。