Error instantiating servlet class servlet.a?

来源:4-6 实现自动回复功能(上)

二道桥十三太保

2017-04-13 18:06

type Exception report

message Error instantiating servlet class servlet.a

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class servlet.a
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:662)


root cause

java.lang.ClassNotFoundException: servlet.a
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
	xmlns="http://java.sun.com/xml/ns/javaee" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <display-name></display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  
  <servlet>
  	<servlet-name>ListServlet</servlet-name>
  	<servlet-class>servlet.ListServlet</servlet-class>
  </servlet>
  <servlet-mapping>
  	<servlet-name>ListServlet</servlet-name>
  	<url-pattern>/List.action</url-pattern>
  </servlet-mapping>
  
  <servlet>
  	<servlet-name>DeleteOneServlet</servlet-name>
  	<servlet-class>servlet.DeleteOneServlet</servlet-class>
  </servlet>
  <servlet-mapping>
  	<servlet-name>DeleteOneServlet</servlet-name>
  	<url-pattern>/DeleteOneServlet.action</url-pattern>
  </servlet-mapping>

  <servlet>
  	<servlet-name>DeleteBatchServlet</servlet-name>
  	<servlet-class>servlet.DeleteBatchServlet</servlet-class>
  </servlet>
  <servlet-mapping>
  	<servlet-name>DeleteBatchServlet</servlet-name>
  	<url-pattern>/DeleteBatchServlet.action</url-pattern>
  </servlet-mapping>
  
   <servlet>
  	<servlet-name>InitTalkServlet</servlet-name>
  	<servlet-class>servlet.InitTalkServlet</servlet-class>
  </servlet>
  <servlet-mapping>
  	<servlet-name>InitTalkServlet</servlet-name>
  	<url-pattern>/InitTalkServlet.action</url-pattern>
  </servlet-mapping>
  
</web-app>
package servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/*
 * 对话页的初始化控制
 */
@SuppressWarnings("serial")
public class InitTalkServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
			 //设置字符编码
			 request.setCharacterEncoding("utf-8");
			 //向页面跳转
			 request.getRequestDispatcher("/WEB-INF/jsp/front/talk.jsp").forward(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doGet(request, response);
	}
}

这是服务器配出错了吗?class文件没有创建成功,怎么解决

写回答 关注

4回答

  • kunfire
    2017-04-14 10:08:53
    已采纳

    这个配置的没有错啊,问题是找不到servlet.a这个类

    二道桥十三太...

    非常感谢!

    2017-04-17 12:14:15

    共 2 条回复 >

  • 慕粉3796571
    2017-06-21 11:26:54

    解决了没;是什么问题

    二道桥十三太...

    解决了 你看我别的回答

    2017-06-23 17:24:44

    共 1 条回复 >

  • 二道桥十三太保
    2017-04-17 12:13:03

    原因找到了,是项目的jar包导入错了,把所有包删了,重新导入就好了

  • 二道桥十三太保
    2017-04-14 11:58:08

    地方大师傅

通过自动回复机器人学Mybatis---基础版

微信公众号自动回复功能学习Mybatis,基础教程加案例实战方式学习

107413 学习 · 786 问题

查看课程

相似问题