0

在此示例中,通过查询从 MySql 获取数据并将值设置SubjectScoreWithSubjectName并存储在数组列表中。但是这个例子在 localhost 中的 tomcat 服务器的帮助下在 eclipse juno 中运行。

在我的本地机器上完成此操作后,我想上传到在线 JBOSS 服务器,但它显示以下错误。?

        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 33

        30: //      out.println("welcome");
        31:         String message = "OOps!!! Invalid Username/Password";
        32:         request.setAttribute("message", message);
        33:         request.getRequestDispatcher("/angular-gauge.jsp").forward(request, response);
        34:     }
        35:     else
        36:     {


        Stacktrace:
            org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        root cause

        org.apache.jasper.JasperException: An exception occurred processing JSP page /angular-gauge.jsp at line 56

        53: 
        54: 
        55:     while (rs.next()) {
        56:         SubjectScoreWithSubjectName score = new SubjectScoreWithSubjectName();
        57: 
        58:         score.setSUBJECT_ID(rs.getInt("SUBJECT_ID"));
        59: 


        Stacktrace:
            org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jsp.login_jsp._jspService(login_jsp.java:88)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        root cause

        javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/table/values/SubjectScoreWithSubjectName
            org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)
            org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
            org.apache.jsp.angular_002dgauge_jsp._jspService(angular_002dgauge_jsp.java:1087)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jsp.login_jsp._jspService(login_jsp.java:88)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        root cause

        java.lang.NoClassDefFoundError: com/table/values/SubjectScoreWithSubjectName
            org.apache.jsp.angular_002dgauge_jsp._jspService(angular_002dgauge_jsp.java:112)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jsp.login_jsp._jspService(login_jsp.java:88)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        root cause

        java.lang.ClassNotFoundException: com.table.values.SubjectScoreWithSubjectName
            java.net.URLClassLoader$1.run(URLClassLoader.java:200)
            java.security.AccessController.doPrivileged(Native Method)
            java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:128)
            org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
            java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            org.apache.jsp.angular_002dgauge_jsp._jspService(angular_002dgauge_jsp.java:112)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jsp.login_jsp._jspService(login_jsp.java:88)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


**This is my java class (setter / getter method class)...

        my com.table.values.SubjectScoreWithSubjectName this class available in Project -> java resources -> src ->com.table.values.SubjectScoreWithSubjectName**



        package com.table.values;

        public class SubjectScoreWithSubjectName {
            private int USER_ID;
            private int SUBJECT_ID;
            private int CUMULATIVE_SCORES;
            private String SUBJECT_NAME;

            public int getUSER_ID() {
                return USER_ID;
            }

            public void setUSER_ID(int uSER_ID) {
                USER_ID = uSER_ID;
            }

            public int getSUBJECT_ID() {
                return SUBJECT_ID;
            }

            public void setSUBJECT_ID(int sUBJECT_ID) {
                SUBJECT_ID = sUBJECT_ID;
            }

            public int getCUMULATIVE_SCORES() {
                return CUMULATIVE_SCORES;
            }

            public void setCUMULATIVE_SCORES(int cUMULATIVE_SCORES) {
                CUMULATIVE_SCORES = cUMULATIVE_SCORES;
            }

            public String getSUBJECT_NAME() {
                return SUBJECT_NAME;
            }

            public void setSUBJECT_NAME(String sUBJECT_NAME) {
                SUBJECT_NAME = sUBJECT_NAME;
            }


        }


**so if i have doing anything wrong then tell me .
thanks in advance.**
4

1 回答 1

2

com/table/values/SubjectScoreWithSubjectName.class您的应用程序无法访问该类。

尝试将其包含在WEB-INF\lib文件夹中,或将其包含在服务器的CLASSPATH

更新

有关 Java EE 应用程序的基本结构,请参见http://www.servletworld.com/servlet-tutorials/web-application-directory-structure.html

通常,您的库(jar)应该在文件夹中web-inf/lib,您的类应该在web-inf/classes文件夹中。

如果com/table/values/SubjectScoreWithSubjectName是一个单独的类,它应该进入 classes 文件夹,但如果它在你正在应用程序中导入的库中,它应该进入 lib 文件夹。

于 2012-11-02T10:17:09.490 回答