JSP网页学习, message Anc exception messageoccurred processing JSP page /checkUser.jsp at line 26

HTTP Status 500 - An exception occurred processing JSP page /register_post.jsp at line 44哪错了_百度知道
HTTP Status 500 - An exception occurred processing JSP page /register_post.jsp at line 44哪错了
String userPassword=request.checklogin(CheckLogin.println(&quot: org:334) javax.java.JasperException.jasper.service(HttpJspBase:
out:727)note The full stack trace of the root cause is available in the Apache Tomcat&#47:
{47.servlet.JspS).将获取到的用户登录信息与数据库中保存的用户信息进行比较44.jasper:568) org.apache.servlet.jasper.java.service(HttpServlet.service(JspServlet.servlet.apache.JspServlet:
String loginMsg = check,userPassword).apache.java.jsp at line 44description The server encountered an internal error that prevented it from fulfilling this request.java.jsptype Exception reportmessage An exception occurred processing JSP page &#47.jasper:70) javax.runtime.42.45;SUCCESS_LOGIN&quot.apache:432) org.jasper.java.JspServletWrapper.CheckLogin.HttpServlet.java.
Stacktrace:727)root cause))46.53 logs.java.servlet.register_005fpost_jsp.http.JspS).serviceJspFile(JspServlet.HttpServlet.java.java.JspServletWrapper:
43.apache,请重新选择用户名&quot.jasper:727) org.service(JspServletWrapper.java:
/&#47.java:470) org.JspServlet.该用户已经存在.checklogin(nickName.servlet:334) javax.HttpJspBase._jspService(register_005fpost_register_post.getParameter(&quot: An exception occurred processing JSP page &#47:60) org.NullPointerException com.serviceJspFile(JspServlet:390) org.service(HttpServlet:118) org.apache.servlet.java.apache.apache:390) org.jsp at line 4441;register_post.http.jasper.apache.service(HttpServlet.userPassword&quot.JspServletWrapper:
if(loginMsg.service(JspServlet.handleJspException(JspServletWrapper.servlet.HttpServlet.exceptionorg.service(JspServletWrapper.equals(&quot.apache.7.0.servlet
提问者采纳
根据com,userPassword),userPassword为空2.CheckLogin,再慢慢解决~:60)表示执行下面语句时:60)看看对应行代码是多少个人估计.checklogin()使用到了其他空的变量先定位问题.CheckLogin.java.lang.checklogin(nickName:1 可能是参数nickName,进入到checklogin方法.java.NullPointerException com.checklogin(CheckLoginroot causejava.checklogin(CheckLogin,有空值异常String loginMsg = check
解决不了了,打算买一份,你那有读书网站的项目吗
没有,现在报什么错误
提问者评价
来自团队:
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁运行jsp出现错误HTTP Status 500_百度知道
运行jsp出现错误HTTP Status 500
service(JspServlet.doHandlePageException(PageContextImpl.jsp at line 63: org.servlet.Properties&quot.HttpS&gt.JasperException.java.servlet.jasper.apache.jasper.HttpJspBase.jasper.HttpS&#47.%@ page import=&quot.HttpServlet.apache.servlet:260) javax.lang.jasper.http:70) javax: 5.java.apache:313) org.http.http.apache.JspServlet!9.service(JspSmypack.JspServletW %&gt.7.runtime:144) org.ServletException: java.java.apache.jsp.JspServlet.PageContextImpl.jasper.jasper:260) javax.BookDB&common.BookDB org.service(JspServletWrapper.serviceJspFile(JspServlet.HttpJspBase: An exception occurred processing JSP page &#47.JspServletW6.jasper:70) javax.java.java.runtime.JspServletWrapper.java.java.jasper.servlet._jspService(check_jsp.serviceJspFile(JspServlet.servlet.jsp: 6.JspServlet.apache.check_jsp: Could not initialize class mypack:717)note The full stack trace of the root cause is available in the Apache Tomcat&#47:794) org.util.apache.http.java.check_jsp.NoClassDefFoundError.PageContextImpl: &lt.jasper.apache.java: 8.servlet.java.servlet:386) org.service(JspServletWrapper:410) bookDB&quot.handlePageException(PageContextImpl.jasper.service(HttpJspBase:useBean id=&quot.servlet.JspServlet.java.jasper:313) org.apache: &lt.java:79) 4.service(HttpServlet:386)
class=&quot.serviceJspFile(JspServlet.service(HttpServlet:519) java.HttpServlet:717) org.java.runtime.apache.java.jasper.apache:
public String convert(String s){Stacktrace.servlet.JspServlet.30 logs.apache._jspService(check_jsp:717)root cause javax: &lt: Could not initialize class mypack.jasper.servlet.handleJspException(JspServletWrapper.service(JspServletWrapper:260) javax.apache:717)root cause java.HttpServlet.servlet.java.apache.service(JspServlet.java. scope=&quot.jasper.JspServlet.service(HttpJspBase.NoClassDefFoundError.java.0.service(HttpS%.jasper.java:313) org.lang.servlet.JspServletWrapper:865) org.servlet:717) org.java.http.servlet.BookDB org.jsp.service(HttpServlet.service(HttpServlet.apache.application&quot.servlettype Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.servlet.exception org
ublic class BookDB {
private static SessionFactory sessionFactory.
} catch (Throwable ex) {
return (User) session.openSession();
public static SessionFactory getSessionFactory() {
return sessionFactory.err.println(&Initial SessionFactory creation failed.openSession(), uname).& + ex);
throw new ExceptionInInitializerError(ex);
public static Session getSession(){
return sessionFactory.load(U
public User getUser(String uname) {
Session session = getSessionFactory();
private BookDB(){}
sessionFactory = new Configuration().configure().buildSessionFactory()
提问者采纳
保留 cglib-nodep.jar试试,也可能是jar对应包的版本比如cglib-nodep-2.1_3.jar 对应spring的 版本是2。.可能是jar包的冲突.5.jar。删除cglib。
我只有一个cglib-2.1.3.jar
来自团队:
其他类似问题
为您推荐:
jsp的相关知识
其他1条回答
BookDB类。确定工程中有这个类吗: Could not initialize class mypack.NoClassDefFoundError? BookDB 是在mypack下吗.BookDB都说了无法初始化mypack,就是找不到这个类了java.lang
确定啊 BookDB就是在源包里的mypack下的
private BookDB(){}构造函数是私有的,无法初始化
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁求帮忙看看如何解决这个错误,急求,不胜感激。_百度知道
求帮忙看看如何解决这个错误,急求,不胜感激。
340) piler.jasper.service(JspServletWrapper.servlet:378) piler.java.java.jasper:646) org.generateClass(JDTCtomcat-7&#92.pile(Compiler: [D:103) piler.JasperException.apache.servlet.jasper.JspCompilationContext.java.java.java.apache:357) org:390) org:typeException reportmessageUnable to compile class for JSP.JspServlet.jasper:468) org.Catalina&#piler.apache: [14] in the generated java file.jsp&#92.servlet.HttpServlet.apache: Unable to compile class for JSP.java] Only a work&#92.javacError(DefaultErrorHandler.37 logs.pile(Compiler: An Clothes&#92.checkLogin_jsp.mysql.jasper.org&#92.apache.javacError(ErrorDispatcher.JspServlet.7: org.apache&#92.apache.service(JspServlet:&#92.jdbc.0;localhost&#92. com.DefaultErrorHandler.java.jasper:331) org.serviceJspFile(JspServlet.apache:728) noteThe full stack trace of the root cause is available in the Apache Tomcat&#47.compile(pile(JspCompilationContext.jasper.Driver resolves to a piler.java.apache.service(HttpServlet.jasper:334) javax.servlet:353) org:descriptionThe server encountered an internal error that prevented it from fulfilling this request.apache.exceptionorgHTTP Status 500 - Unable to compile class for JSP
表名String url = &;localhost/ /;/ /数据库用户名String userPasswd = &%&String password = AND password='String driverName = &quot.*&第14行} catch (ClassNotFoundException e) {root&+ userName + &/ + dbName + & / &#47.&#47.clothes&quot.forName(&quot.Driver&quot:mysql:&密码String dbName = &java.getParameter(& + userP/原页面代码如下; + password + &' //%String logname = request:&#47.println(e);/数据库名String tableName = &联结字符串try {CString sql = &users&%&).println(e).createStatement();com.Driver&ResultSet rs =+ logname + &}try {Connection con = DriverM);logname&quot.);}%&gt.getParameter(&quot.jdbc.jdbc.&&%@ page contentType=&&password=&.getConnection(url);Statement statement =&驱动程序名String userName = &&/&%@ page import=&quot?user=&text/ charset=utf-8&password&.%@ page import=&quot.executeQuery(sql);&'; /; /SELECT * FROM users where logname ='%&/&&quot.Driver& } catch (SQLException e) {out
我有更好的答案
你的out.println的out是哪里来的,有定义吗?
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁java - An exception occurred processing JSP page - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
I am attempting to return the count of mysql rows. I get the following error when I run the .jsp file:
org.apache.jasper.JasperException: An exception occurred processing
JSP page /index.jsp at line 54
Which is this line of code:
// count posts in category 1
catCount = conn.countCategoryPosts(1);
I know the database connection is setup fine.
This is the countCategoryPosts method.
public int countCategoryPosts(int ncatID) throws Exception{
int catID = ncatID;
sql = "SELECT COUNT(*) FROM crm_posts WHERE cat_id = ?";
prep = conn.prepareStatement(sql);
prep.setInt(1, catID);
rs = prep.executeQuery();
}catch(Exception e){
e.printStackTrace();
return rs.getInt(1);
What is causing the error?
EDIT: As requested the full stacktrace:
type Exception report
message An exception occurred processing JSP page /index.jsp at line 54
description The server encountered an internal error that prevented it from fulfilling this request.
org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 54
id = Integer.parseInt(catAttributes[1]);
// count posts in this category
catCount = conn.countCategoryPosts(1);
// get posts in this category
postList = conn.getCategoryPosts(id);
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
root cause
javax.servlet.ServletException: java.sql.SQLException: Before start of result set
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
org.apache.jsp.index_jsp._jspService(index_jsp.java:208)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
root cause
java.sql.SQLException: Before start of result set
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1084)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
com.mysql.jdbc.ResultSetImpl.checkRowPos(ResultSetImpl.java:850)
com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2705)
com.servlet.explore.dbCon.countCategoryPosts(dbCon.java:103)
org.apache.jsp.index_jsp._jspService(index_jsp.java:145)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
1,37083063
You can not call
rs.getInt(1)
if you did not move your cursor with
rs.next() // for example
This should work:
public int countCategoryPosts(int ncatID) throws Exception{
int catID = ncatID;
int result = 0;
sql = "SELECT COUNT(*) FROM crm_posts WHERE cat_id = ?";
prep = conn.prepareStatement(sql);
prep.setInt(1, catID);
rs = prep.executeQuery();
if (rs.next()) {
result = rs.getInt(1);
}catch(Exception e){
e.printStackTrace();
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled

我要回帖

更多关于 jni exceptioncheck 的文章

 

随机推荐