免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3305 | 回复: 5
打印 上一主题 下一主题

[Web] TOMCTA的错误Unable to compile class for JSP [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-15 11:29 |只看该作者 |倒序浏览
整个错误如下  高手帮忙解决哈
type Exception report

message

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

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 1 in the jsp file: /gxc/index.jsp

Generated servlet error:
    [javac] Compiling 1 source file

D:\Tomcat 4.1\work\Standalone\localhost\_\gxc\index_jsp.java:44: package com.util.gxc does not exist
      com.util.gxc.mysqlDB db = null;
                  ^



An error occurred at line: 1 in the jsp file: /gxc/index.jsp

Generated servlet error:
D:\Tomcat 4.1\work\Standalone\localhost\_\gxc\index_jsp.java:46: package com.util.gxc does not exist
        db = (com.util.gxc.mysqlDB) pageContext.getAttribute("db", PageContext.PAGE_SCOPE);
                          ^



An error occurred at line: 1 in the jsp file: /gxc/index.jsp

Generated servlet error:
D:\Tomcat 4.1\work\Standalone\localhost\_\gxc\index_jsp.java:49: package com.util.gxc does not exist
            db = (com.util.gxc.mysqlDB) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.util.gxc.mysqlDB");
                              ^
3 errors


        at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
        at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:248)
        at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:315)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:328)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:427)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:142)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)



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

论坛徽章:
0
2 [报告]
发表于 2006-03-15 11:40 |只看该作者
错误再明显不过了,
package com.util.gxc does not exist
com.util.gxc 这个包不存在,你应该在WEB-INF/classes/放这个包,或者放在
WEB-INF/lib 下,然后在JSP文件里用<%@ page import="包名"%>
应该就OK了!

论坛徽章:
0
3 [报告]
发表于 2006-03-15 14:24 |只看该作者
不过改了一下又有错误了

type Exception report

message

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

exception

org.apache.jasper.JasperException
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:207)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:94
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:94
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:235
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:11
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:94
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:94
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)


root cause

java.lang.NullPointerException
        at org.apache.jsp.index_jsp._jspService(index_jsp.java:135)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:94
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:94
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:235
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:11
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)

论坛徽章:
0
4 [报告]
发表于 2006-03-15 15:02 |只看该作者
空指针异常,也就是有些对象变量,你没有创建其实例,就用它来调用空对象的属性或者方法。
认真检查你的JSP页面或者相关的类。

论坛徽章:
0
5 [报告]
发表于 2006-03-15 19:06 |只看该作者
搞定了没有啊??

论坛徽章:
0
6 [报告]
发表于 2006-03-22 21:56 |只看该作者
已经搞定了,重新装了一下TOMCAT就好了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP