Java 建立WEB项目。500报错。
HTTPStatus500-Errorinstantiatingservletclassmydatabase.SelectServlettypeExceptionrepo...
HTTP Status 500 - Error instantiating servlet class
mydatabase.SelectServlet
type Exception report
message Error instantiating servlet class
mydatabase.SelectServlet
description The server encountered an internal error that prevented
it from fulfilling this request.
exception
javax.servlet.ServletException: Error instantiating servlet class mydatabase.SelectServlet
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
求问是什么错??
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/plain;charset=UTF-8");
PrintWriter out = response.getWriter();
String RES="";
String type=request.getParameter("radio");
String key=request.getParameter("text");
if(type.equals("student")){
RES=DBOperator.getstudent(key);
System.out.println(RES);
}
if(type.equals("teacher")){
RES=DBOperator.getteacher(key);
System.out.println(RES);
}
}
}
前面都是自动生成的,这里是自己写的。 展开
mydatabase.SelectServlet
type Exception report
message Error instantiating servlet class
mydatabase.SelectServlet
description The server encountered an internal error that prevented
it from fulfilling this request.
exception
javax.servlet.ServletException: Error instantiating servlet class mydatabase.SelectServlet
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
求问是什么错??
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/plain;charset=UTF-8");
PrintWriter out = response.getWriter();
String RES="";
String type=request.getParameter("radio");
String key=request.getParameter("text");
if(type.equals("student")){
RES=DBOperator.getstudent(key);
System.out.println(RES);
}
if(type.equals("teacher")){
RES=DBOperator.getteacher(key);
System.out.println(RES);
}
}
}
前面都是自动生成的,这里是自己写的。 展开
2014-06-06
展开全部
Error instantiating servlet class mydatabase.SelectServlet
无法初始化这个SelcetServlet
你可以把这个代码注释掉,看还有错误吗》?
RES=DBOperator.getstudent(key);
与数据库相关东西全部注释掉
你的给报错异常信息不全啊
无法初始化这个SelcetServlet
你可以把这个代码注释掉,看还有错误吗》?
RES=DBOperator.getstudent(key);
与数据库相关东西全部注释掉
你的给报错异常信息不全啊
展开全部
报500错误一般是你代码错误,可以去代码页面查看是否有红色的X,Error instantiating servlet class mydatabase.mydatabase类实例化错误,根据你下面的apache和mydatabase,可能是数据库连接那一部分出问题。
希望能帮到你!
希望能帮到你!
追问
没有红色的叉。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
贴代码!!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
吧tomcat中servletAPI加到项目当中去
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
说你实例化mydatabase.SelectServlet时出错,需要贴出相关部分的代码才能分析具体原因!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询