我一直在学习Web服务和东西,最后能够构建我的第一个噱头代码,但每当我尝试在eclipse上创建我的DAO类的Web服务时,我最终无法访问它在localhost上的会话(服务,验证,管理)。
其他信息:我将tom2与tomcat 6.0.41一起使用(出于教程的缘故)并试图访问最近创建的MySQL数据库" ExemploWS"通过http://localhost:8080/ExemploWS/,工作正常,直到我尝试浏览它。
同时使用XAMPP控制面板启动Apache和MySQL。 所以我要离开连接类,然后在访问http://localhost:8080/ExemploWS/services/listServices时遇到错误。
package br.com.ExemploWS;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConectaMySQL {
private static final String url = "jdcb:mysql://localhost/exemplows";
private static final String user = "root";
private static final String pass = "";
public static Connection obtemConexao() throws SQLException {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
return DriverManager.getConnection(url,user,pass);
}
}
HTTP状态500 - Servlet AxisServlet的Servlet.init()抛出 例外
输入例外报告
消息Servlet.init()for servlet AxisServlet抛出异常
description服务器遇到阻止它的内部错误 完成此请求。
例外
javax.servlet.ServletException:servlet的Servlet.init()AxisServlet 扔了例外 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606) org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(未知来源)根本原因
java.lang.NoClassDefFoundError: 组织/阿帕奇/ WS /公/模式/解析器/的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。(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.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606) org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(未知来源)根本原因
抛出java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) 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。(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.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606) org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Unknown Source)note完整的堆栈跟踪 根本原因可在Apache Tomcat /6.0.41日志。
中找到Apache Tomcat / 6.0.41'
答案 0 :(得分:0)
将此类添加到您的应用程序中,它已丢失:
java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/resolver/URIResolver
它位于commons-xmlschema中,在此处找到:http://mvnrepository.com/artifact/org.apache.ws.commons.schema/XmlSchema