HTTP Status 500报错数据库登录的用户密码问题

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Blues1021/article/details/83983690

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /login.jsp at line 44

41:     
42:         <div id="divlogin" >
43:         <html:form action="/userLogin">
44:             用户名&nbsp;:<html:text property="loginName" styleClass="textbox"/><html:errors property="loginName"/><br/>
45:            密 &nbsp;码&nbsp;:<html:password property="loginPass" styleClass="textbox"/><html:errors property="loginPass"/><br/><br/>
46:             &nbsp; &nbsp;   <html:radio property="type" value="1">学生&nbsp; </html:radio><html:radio property="type" value="2">教师&nbsp; </html:radio><html:radio property="type" value="3">管理员</html:radio><html:errors property="type"/>
47:             <br/>            
root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
    org.apache.jsp.login_jsp._jspService(login_jsp.java:153)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
其中改正用户名和密码后重新部署,不用重新启动tomcat服务器。

展开阅读全文

HTTP Status 500 报错

09-17

昨天从书上抄了个JSP文件,昨天调试还没有问题。今天就一直报这个错误。。。查了下把 el-ri.jar jsp-api.jarrn拷过来也不管用。。。我用的是JDK1.6和TOMCAT6.。。。。rn root cause rnjava.lang.NoClassDefFoundError: javax/el/ELResolverrn java.lang.ClassLoader.defineClass1(Native Method)rn java.lang.ClassLoader.defineClass(ClassLoader.java:621)rn java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)rn java.net.URLClassLoader.defineClass(URLClassLoader.java:260)rn java.net.URLClassLoader.access$000(URLClassLoader.java:56)rn java.net.URLClassLoader$1.run(URLClassLoader.java:195)rn java.security.AccessController.doPrivileged(Native Method)rn java.net.URLClassLoader.findClass(URLClassLoader.java:188)rn sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)rn java.lang.ClassLoader.loadClass(ClassLoader.java:307)rn java.lang.ClassLoader.loadClass(ClassLoader.java:300)rn sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)rn java.lang.ClassLoader.loadClass(ClassLoader.java:300)rn java.lang.ClassLoader.loadClass(ClassLoader.java:252)rn java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:200)rn org.apache.jsp.login_jsp._jspInit(login_jsp.java:22)rn org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)rn org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrn即使我把一个最简单的htm文件,改成JSP文件,也是报这个错误。rnrnrnrnrn 论坛

jsp页面报错 HTTP Status 500

08-08

HTTP Status 500 - An exception occurred processing JSP page /SearchList.jsp at line 27rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage An exception occurred processing JSP page /SearchList.jsp at line 27rnrndescription The server encountered an internal error that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: An exception occurred processing JSP page /SearchList.jsp at line 27rnrn24: rn25: <%rn26: String sql="select * from student order by id";rn27: java.util.List list = sBean.getSearch(sql);rn28: for(java.util.Iterator it = list.iterator();it.hasNext();)rn29: rn30: jBean=(server.JavaBean)it.next();rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rnrnrnroot cause rnrnjava.lang.NullPointerExceptionrn server.SqlBean.getSearch(SqlBean.java:150)rn org.apache.jsp.SearchList_jsp._jspService(SearchList_jsp.java:104)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.rnrn代码如下:rn<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8"%>rn <%rnString path = request.getContextPath();rnString basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";rn%>rn rnrnrnrn rn 显示记录rnrnrnrnrn rn rn IDrn Namern passwordrnrnrnrn<%rn String sql="select * from student order by id";rn [color=#FF0000]java.util.List list = sBean.getSearch(sql);[/color] rn for(java.util.Iterator it = list.iterator();it.hasNext();)rn rn jBean=(server.JavaBean)it.next();rn %> rn rn rn <%=jBean.getId() %>rn <%=jBean.getName() %>rn <%=jBean.getPassword() %>rn rn 增加rn 删除rn 更新rn rn rn <%rn rn %>rn rnrn rnrnrnrnrnrn红色的是错误的哪行,我看过一些帖子,说是sql为空值所以报错,我想知道,是不是jsp没有和SQL server连接上,这一步也会报错呢??rn求解答,新手上路[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/2.gif][/img] 论坛

HTTP Status 500问题

03-28

HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperExceptionrn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)rn org.apache.jsp.index_jsp._jspService(index_jsp.java:91)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnrnjava.lang.NullPointerExceptionrn org.apache.jsp.left_jsp._jspService(left_jsp.java:182)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)rn org.apache.jsp.index_jsp._jspService(index_jsp.java:91)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.0.30rn怎么解决?rn 论坛

关于HTTP Status 500 - 报错问题

07-09

下面是我运行是报的错什么意思啊?rn怎么改我的错误让它能编译通过?我JSP 的代码在最后,帮忙看看吧,有加分,谢谢!rnorg.apache.jasper.JasperException: Unable to compile class for JSPrnrnAn error occurred at line: 111 in the jsp file: /WebContent/search.jsprnGenerated servlet error:rnSearchResultBean cannot be resolved to a typernrnAn error occurred at line: 111 in the jsp file: /WebContent/search.jsprnGenerated servlet error:rnSearchResultBean cannot be resolved to a typernrnrn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnrnorg.apache.jasper.JasperException: Unable to compile class for JSPrnrnAn error occurred at line: 111 in the jsp file: /WebContent/search.jsprnGenerated servlet error:rnSearchResultBean cannot be resolved to a typernrnAn error occurred at line: 111 in the jsp file: /WebContent/search.jsprnGenerated servlet error:rnSearchResultBean cannot be resolved to a typernrnrn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)rn org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnJSP 部分代码rnrnrn <%@ page language="java" contentType="text/html; charset=utf-8"rn pageEncoding="utf-8"%>rn rn <%@ page import="java.util.List" %>rn <%@ page import="sample.dw.paper.lucene.search.*" %>rn Lucene Search Engine Demo Clientrn rn rn rn rn rn rn Lucene Search Engine Demo Clientrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn <%rn List searchResult = (List)request.getAttribute("searchResult");rn int resultCount = 0;rn if(null != searchResult)rn resultCount = searchResult.size();rn rn for(int i = 0; i < resultCount; i++)rn SearchResultBean resultBean = (SearchResultBean)searchResult.get(i);rn String title = resultBean.getHtmlTitle();rn String path = resultBean.getHtmlPath();rn %>rn rn <%=title %>rn rn rn <%rn rn %>rn rn rn rn rn rn rnrnrn 论坛

求助:HTTP Status 500

12-08

运行JSP+JAVABEAN在tomcat下出现这个问题rn谁帮我看看rntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 25 in the jsp file: /bookstore/catalog.jsprnBookBean cannot be resolved to a typern22: <%rn23: while(it.hasNext())rn24: rn25: BookBean book=(BookBean)it.next();rn26: String title=book.getTitle();rn27: float price=book.getPrice();rn28: int bookId=book.getId(); rnrnrnAn error occurred at line: 25 in the jsp file: /bookstore/catalog.jsprnBookBean cannot be resolved to a typern22: <%rn23: while(it.hasNext())rn24: rn25: BookBean book=(BookBean)it.next();rn26: String title=book.getTitle();rn27: float price=book.getPrice();rn28: int bookId=book.getId(); rnrnrnStacktrace:rn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)rn org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.rn 论坛

http status 500 -

07-17

各位大侠,小弟这到底是怎么了?其他的jsp文件都运行正常。。怎么这个就不行了呢??rn 帮忙指导一下。。不胜感激!rnrnrnrnrnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Unable to compile class for JSPrnrnGenerated servlet error:rnD:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test\org\apache\jsp\_1_1\index_jsp.java:6: package kjb.main does not existrnimport kjb.main.DealString;rn ^rnrnrnAn error occurred at line: 20 in the jsp file: /1.1/index.jsprnGenerated servlet error:rnD:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test\org\apache\jsp\_1_1\index_jsp.java:68: cannot find symbolrnsymbol : class DealStringrnlocation: class org.apache.jsp._1_1.index_jsprn DealString ds = new DealString();rn ^rnrnrnAn error occurred at line: 20 in the jsp file: /1.1/index.jsprnGenerated servlet error:rnD:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\test\org\apache\jsp\_1_1\index_jsp.java:68: cannot find symbolrnsymbol : class DealStringrnlocation: class org.apache.jsp._1_1.index_jsprn DealString ds = new DealString();rn ^rn3 errorsrnrnrnrn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)rn org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.rnrn 论坛

HTTP Status 500

10-12

HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjava.lang.NullPointerExceptionrn com.accp.s2t121.dao.UserDao.Insert(UserDao.java:22)rn com.accp.s2t121.biz.Business.Insert(Business.java:9)rn com.accp.s2t121.servlet.RegisterServlet.service(RegisterServlet.java:46)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.5.26rnrnrnrn出现以上的错误rn[code=HTML]rn<--这个是主页面-->rnrnrnrn rn Insert title herernrnrn rn 用户名: rn 密码: rn rn rn rnrnrn[/code]rnrn以下是分了层来做的rn[code=Java]rnpackage com.accp.s2t121.vo;rnrnpublic class User rnrn private int uid;rn private String uname;rn private String password;rn rn public String getPassword() rn return password;rn rn public void setPassword(String password) rn this.password = password;rn rn public int getUid() rn return uid;rn rn public void setUid(int uid) rn this.uid = uid;rn rn public String getUname() rn return uname;rn rn public void setUname(String uname) rn this.uname = uname;rn rnrnrn[/code]rnrn[code=Java]package com.accp.s2t121.servlet;rnrnimport java.io.IOException;rn//import java.util.Scanner;rnrnimport javax.servlet.Servlet;rnimport javax.servlet.ServletConfig;rnimport javax.servlet.ServletException;rnimport javax.servlet.ServletRequest;rnimport javax.servlet.ServletResponse;rn//import javax.servlet.http.*;rnrnimport com.accp.s2t121.biz.Business;rnimport com.accp.s2t121.vo.User;rnrnpublic class RegisterServlet implements Servlet rnrn public void destroy() rn rnrn public ServletConfig getServletConfig() rn return null;rn rnrn public String getServletInfo() rn return null;rn rnrn public void init(ServletConfig arg0) throws ServletException rn rnrn public void service(ServletRequest arg0, ServletResponse arg1) throws ServletException, IOException rn rn // 1 获得用户输入的数据 rn String uname = arg0.getParameter("txtUname"); rn String password = arg0.getParameter("txtPassword");rn rn // 2 验证rn rn // 3 封装rn User user = new User();rn user.setUname(uname);rn user.setPassword(password);rn rn // 4 调用底层代码实现功能rn Business.Insert(user);rn rn// // 5 输出操作结果rn arg1.setCharacterEncoding("gbk");rn arg1.getWriter().print("注册成功");rn rn // 5 显示操作结果 rn //((HttpServletResponse)arg1).sendRedirect("../ok.html");rn// ((HttpServletResponse)arg1).sendRedirect("/Demo1010/ok.html");rn rnrnrnrnrnrnrnrnrnrnrnrnrn[/code]rn[code=Java]package com.accp.s2t121.dao;rnrnimport java.sql.*;rnrnpublic class ConnectionManager rn /**rn * 获得数据库连接对象rn * @returnrn * @throws ClassNotFoundException rn * @throws SQLException rn */rn public static Connection getConn() rn Connection conn=null;rn rn tryrn rn String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; //加载java驱动 rn String dbURL = "jdbc:sqlserver://localhost:1433;DatabaseName=Demo1010"; //连接服务器和数据库smsdb rn String userName = "sa"; //默认用户名 rn String userPwd = "123456"; //密码rn Class.forName(driverName); rn conn = DriverManager.getConnection(dbURL, userName, userPwd); rn rn catch(Exception e)rn e.printStackTrace();rn rn rn return conn; rn rn /**rn * 关闭数据库连接对象rn * @param connrn */rn public static void close(Connection conn)rn try rn if(conn!=null)rn conn.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn /**rn * 关闭语句对象rn * @param stmtrn */rn public static void close(Statement stmt)rn try rn if(stmt!=null)rn stmt.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn /**rn * 关闭预处理语句对象rn * @param stmtrn */rn public static void close(PreparedStatement stmt)rn try rn if(stmt!=null)rn stmt.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn /**rn * 关闭结果集rn * @param stmtrn */rn public static void close(ResultSet rs)rn try rn if(rs!=null)rn rs.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn /**rn * 关闭数据库连接对象、语句对象、结果集rn * @param stmtrn */rn public static void close(Connection conn,Statement stmt,ResultSet rs)rn try rn if(rs!=null)rn rs.close();rn if(stmt!=null)rn stmt.close();rn if(conn!=null)rn conn.close();rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn /**rn * 关闭数据库连接对象、预处理语句对象、结果集rn * @param stmtrn */rn public static void close(Connection conn,PreparedStatement stmt,ResultSet rs)rn try rn if(rs!=null)rn rs.close();rn if(stmt!=null)rn stmt.close();rn if(conn!=null)rn conn.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn rnrnrnrnrnrn//String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; //加载JDBC驱动 rn//String dbURL = "jdbc:sqlserver://localhost:1433;DatabaseName=BookShop1"; //连接服务器和数据库smsdb rn//String userName = "sa"; //默认用户名 rn//String userPwd = "sasasasasa"; //密码rn//Class.forName(driverName); rn//conn = DriverManager.getConnection(dbURL, userName, userPwd); rnrn[/code]rn[code=Java]package com.accp.s2t121.dao;rnrnimport java.sql.*;rnrnimport com.accp.s2t121.vo.User;rnrnpublic class UserDao rn rn /**rn * 注册新用户rn *rn */rn public void Insert(User user)rn rn Connection conn = null;rn PreparedStatement pstmt = null;rn rn String sql = "insert into [User](uname,password) values(?,?)";rn rn try rn conn = ConnectionManager.getConn();rn pstmt = conn.prepareStatement(sql);rn rn pstmt.setString(1, user.getUname());rn pstmt.setString(2, user.getPassword());rn rn pstmt.execute();rn rn catch (SQLException e) rn e.printStackTrace();rn rn rn rnrnrnrnrnrnrnrnrnrn[/code]rnrn[code=Java]package com.accp.s2t121.biz;rnrnimport com.accp.s2t121.dao.UserDao;rnimport com.accp.s2t121.vo.User;rnrnpublic class Business rn rn public static void Insert(User user)rn new UserDao().Insert(user);rn rn rnrn[/code]rn 论坛

HTTP Status 500 -

03-29

HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: org.hibernate.exception.SQLGrammarException: could not execute queryrn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnorg.hibernate.exception.SQLGrammarException: could not execute queryrn org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)rn org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn org.hibernate.loader.Loader.doList(Loader.java:2148)rn org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)rn org.hibernate.loader.Loader.list(Loader.java:2024)rn org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)rn org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)rn org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)rn org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)rn org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)rn org.apache.jsp.index_jsp._jspService(index_jsp.java:135)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnjava.sql.SQLException: Unknown column 'bookinfo0_.isbn' in 'field list'rn com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)rn com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)rn com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)rn com.mysql.jdbc.Connection.execSQL(Connection.java:2994)rn com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936)rn com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030)rn org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)rn org.hibernate.loader.Loader.getResultSet(Loader.java:1669)rn org.hibernate.loader.Loader.doQuery(Loader.java:662)rn org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)rn org.hibernate.loader.Loader.doList(Loader.java:2145)rn org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)rn org.hibernate.loader.Loader.list(Loader.java:2024)rn org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)rn org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)rn org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)rn org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)rn org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)rn org.apache.jsp.index_jsp._jspService(index_jsp.java:135)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.rnrnrn--------------------------------------------------------------------------------rnrnrnrnrnrnrnrnrnApache Tomcat/6.0.18rnrn2010-3-29 16:20:26 org.apache.catalina.core.AprLifecycleListener initrn信息: Loaded APR based Apache Tomcat Native library 1.1.10.rn2010-3-29 16:20:26 org.apache.catalina.core.AprLifecycleListener initrn信息: APR capabilities: IPv6 [false], sendfile [true], accept filters [false], random [true].rn2010-3-29 16:20:26 org.apache.coyote.http11.Http11AprProtocol initrn信息: Initializing Coyote HTTP/1.1 on http-8080rn2010-3-29 16:20:26 org.apache.coyote.ajp.AjpAprProtocol initrn信息: Initializing Coyote AJP/1.3 on ajp-8009rn2010-3-29 16:20:26 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 860 msrn2010-3-29 16:20:26 org.apache.catalina.core.StandardService startrn信息: Starting service Catalinarn2010-3-29 16:20:26 org.apache.catalina.core.StandardEngine startrn信息: Starting Servlet Engine: Apache Tomcat/6.0.18rn[color=#FF0000]log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).rnlog4j:WARN Please initialize the log4j system properly.[/color]2010-3-29 16:20:28 org.apache.catalina.core.ApplicationContext logrn信息: ContextListener: contextInitialized()rn2010-3-29 16:20:28 org.apache.catalina.core.ApplicationContext logrn信息: SessionListener: contextInitialized()rn2010-3-29 16:20:28 org.apache.coyote.http11.Http11AprProtocol startrn信息: Starting Coyote HTTP/1.1 on http-8080rn2010-3-29 16:20:28 org.apache.coyote.ajp.AjpAprProtocol startrn信息: Starting Coyote AJP/1.3 on ajp-8009rn2010-3-29 16:20:28 org.apache.catalina.startup.Catalina startrn信息: Server startup in 2017 msrnrnrnrn 论坛

HTTP Status 500 求救。

12-12

最近在写大作业,JAVA新手,发布到Tomcat报500错误,信息如下:rntype Exception reportrnrnmessage Servlet execution threw an exceptionrnrndescription The server encountered an internal error that prevented it from fulfilling this request.rnrnexceptionrnrnjavax.servlet.ServletException: Servlet execution threw an exceptionrn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rnroot causernrnjava.lang.NoClassDefFoundError: org/apache/lucene/store/Directoryrn SearchEngine.SearchServlet.doGet(SearchServlet.java:47)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:622)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:729)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rnroot causernrnjava.lang.ClassNotFoundException: org.apache.lucene.store.Directoryrn org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)rn org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)rn SearchEngine.SearchServlet.doGet(SearchServlet.java:47)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:622)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:729)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rnnote The full stack trace of the root cause is available in the Apache Tomcat/8.0.39 logs.rnrnApache Tomcat/8.0.39rn求各位大神帮忙看一下,感激不尽[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/1.gif][/img] 论坛

遇到HTTP Status 500 - 问题

04-30

description The server encountered an internal error () that prevented it from fulfilling this request.rnexception rnjava.lang.NullPointerExceptionrn bookp.Datebase.queryboolen(Datebase.java:79)rn Servlet.Tianjia.doPost(Tianjia.java:50)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.rnrnrnrnbookp.Datebase.queryboolen(Datebase.java:79)那个空指针怎么解决啊 在下面红色代码段rnrnpackage bookp;rnrnimport java.io.InputStream;rnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.PreparedStatement;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnimport java.util.Properties;rnrnrnpublic class Datebase rn String dbDriver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; // 连接sql数据库的方法rn String url = "";rn String username = "";rn String password = "";rn Connection dbcon=null;rn Statement stmt=null;rn ResultSet rs=null;rn PreparedStatement statement=null;rn private static String FILE_PATH_NAME = "/database.properties";//数据库路径名rnrn /*rn * 初始化操作,包括给变量赋初值和连接数据库rn */rn public Datebase() rn try rn InputStream in = getClass().getResourceAsStream(FILE_PATH_NAME);rn Properties props = new Properties();rn props.load(in);rn in.close();rn System.out.println(getClass().getResourceAsStream(FILE_PATH_NAME));rn username = props.getProperty("username");rn password = props.getProperty("password");rn url = "jdbc:sqlserver://localhost:" + props.getProperty("port")rn + ";DatabaseName=library";rn Class.forName(dbDriver); // 声明所调用的类包rn dbcon = DriverManager.getConnection(url, username, password); // 获得数据库的连接对象rn catch (Exception e) rn e.printStackTrace();rn rn rn rn /*rn * 对数据库执行插入、删除、更新 等操作,返回一个布尔值。rn */rn public boolean exeSql(String strSql) rn try rn stmt = dbcon.createStatement(); //由Connection对象创建Statement对象。rn stmt.executeUpdate(strSql); //可以返回受影响的行数。rn return true;rn catch (Exception e) rn System.out.println(e.toString());rn return false;rn rn rn /*rn * 执行查询操作,返回一个ResultSet类型的对象。rn */rn public ResultSet exeSqlQuery(String strSql) rn try rn stmt = dbcon.createStatement();rn rs = stmt.executeQuery(strSql); //返回单个ResultSet对象即查询结果集。rn catch (SQLException e) rn System.out.println(e.toString());rn rs = null;rn rn return rs;rn rn rn /*rn *执行查询,返回boolean型。rn */rn [color=#FF0000]public boolean queryboolen(String strSql)rn boolean bb=false;rn tryrn stmt=dbcon.createStatement();rn rs=stmt.executeQuery(strSql);rn if(rs.next())rn bb=true;rn rn catch(SQLException e)rn System.out.println(e.toString());rn bb=false;rn rn return bb;rn rn [/color]rn /*rn * 使用预编译语句,由Connection对象创建PrepareStatement对象。rn * 然后执行sql语句中的每一个问号【从1开始编号】,比如statement.setString(1,username);rn * 然后执行ResultSet rest=statement.executeQuery() 来执行sql语句;即返回的是ResultSet查询结果集,rn * 然后可用while(rest.next())来列出,比如rest。getString("name")等。rn * 如果查询语句没有问号的话直接执行PrepareStatement对象statement的executeQuery()返回ResultSet结果集。rn * rn * 如果是插入语句也是先设置预处理语句参数即问号。然后执行statement.executeUpdate()执行sql语句。rn */rn public PreparedStatement exeprepared(String strSql)rn rn try rn statement=dbcon.prepareStatement(strSql); //只是返回PrepareStatement对象,不是结果集。rn catch (SQLException e) rnrn e.printStackTrace();rn rn return statement;rn rn rn /*rn * 返回满足条件的记录条数【此法是通用方法】,要求sql语句必须是:countnumrn * select count(user_id) countnum from userinfo where education='硕士'rn * */rn public int get_number(String sql)rn int num=0;rn tryrn rn stmt=dbcon.createStatement();rn rs=stmt.executeQuery(sql);rn if(rs.next())rn num=rs.getInt("countnum");rn rn rs.close();rn catch(SQLException e)rn System.out.println(e.toString());rn rn return num; rn rnrn rnrn/*rn *关闭数据库连接rn */rn public void close()rn rn tryrn if(rs!=null)rn rs.close();rn if(stmt!=null)rn stmt.close();rn if(dbcon!=null)rn dbcon.close();rn catch(Exception e)rn rn System.out.println(e.getMessage());rn rn rnrn rn public static void main(String[] args) rn ResultSet rs1;rn Datebase db=new Datebase();rn rs1=db.exeSqlQuery("select * from userinfo");rn try rn while(rs1.next())rn rn System.out.println(rs1.getString(2)); rn rn catch (Exception e) rn e.printStackTrace();rn rn db.close(); rn rnrnrnrn 论坛

HTTP Status 500 错误

03-09

HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: java.sql.SQLException: Column 'grade' not found.rn org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnjava.sql.SQLException: Column 'grade' not found.rn com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)rn com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:987)rn com.mysql.jdbc.ResultSet.getString(ResultSet.java:5584)rn org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:263)rn org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:263)rn j2eebbs.User.getUserGrade(User.java:113)rn j2eebbs.admin.action.AdminLoginAction.execute(AdminLoginAction.java:39)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.rnrn 论坛

HTTP Status 500 - 的错误

11-08

异常如下:rnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: No selector attribute (cookie/header/name/parameter) was specifiedrn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)rn org.apache.jsp.form.hello_jsp._jspService(hello_jsp.java:96)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnrnjavax.servlet.jsp.JspException: No selector attribute (cookie/header/name/parameter) was specifiedrn org.apache.struts.taglib.logic.PresentTag.condition(PresentTag.java:99)rn org.apache.struts.taglib.logic.PresentTag.condition(PresentTag.java:54)rn org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTagBase.java:174)rn org.apache.jsp.form.hello_jsp._jspx_meth_logic_present_0(hello_jsp.java:232)rn org.apache.jsp.form.hello_jsp._jspx_meth_html_html_0(hello_jsp.java:138)rn org.apache.jsp.form.hello_jsp._jspService(hello_jsp.java:87)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.rnrn不知道是什么问题呢 论坛

HTTP Status 500错误问题

05-26

HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Unable to compile class for JSPrnrnAn error occurred at line: 14 in the jsp file: /index.jsprnGenerated servlet error:rnsSystem.out cannot be resolved to a typernrnrnorg.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)rnorg.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)rnorg.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)rnorg.apache.jasper.compiler.Compiler.compile(Compiler.java:297)rnorg.apache.jasper.compiler.Compiler.compile(Compiler.java:276)rnorg.apache.jasper.compiler.Compiler.compile(Compiler.java:264)rnorg.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)rnorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)rnorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rnorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rnjavax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.5.15 论坛

HTTP Status 500 - 错误?

05-30

type Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: An exception occurred processing JSP page /loadEmps.jsp at line 11rnrn8: pageEncoding="utf-8"%>rn9: rn10: rn11: <%Class.forName("com.mysql.jdbc.Driver");rn12: String url ="jdbc:mysql://localhost:3306/hr";rn13: String user = "root";rn14: String password = "";rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnjavax.servlet.ServletException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driverrn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)rn org.apache.jsp.loadEmps_jsp._jspService(loadEmps_jsp.java:122)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnjava.lang.ClassNotFoundException: com.mysql.jdbc.Driverrn org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)rn org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)rn org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:128)rn org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)rn java.lang.Class.forName0(Native Method)rn java.lang.Class.forName(Class.java:186)rn org.apache.jsp.loadEmps_jsp._jspService(loadEmps_jsp.java:68)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.rn 论坛

没有更多推荐了,返回首页