如何解决Unable to compile class for JSP

用eclipse新搭建了一个项目,项目启动成功后报了如下错误:

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 generated java file The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439) org.apache.jasper.compiler.Compiler.compile(Compiler.java:349) org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) org.apache.jasper.compiler.Compiler.compile(Compiler.java:314) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29

 logs.

如何解决Unable to compile class for JSP

找了一圈最后发现是jar冲突。jsp-api-2.1.jar和jsp-api-2.0.jar冲突,去掉2.0重启没事。

阅读更多

Unable to compile class for JSP 怎么解决啊.

08-26

我平台Mysql 5.0,netbeans 5.5rn做的东西一开始能运行,忽然就rnrnUnable to compile class for JSPrnHTTP 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 JSPrn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:342)rn org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:248)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)rnrnrnroot cause rnrnCompile failed; see the compiler error output for details.rn org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)rn org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)rn org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:216)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.5.9rnrnrnrn求解!!!!!!!

不一样的:Unable to compile class for JSP

05-20

在别的地方可以但在我的电脑就不行rnrnrnorg.apache.jasper.JasperException: Unable to compile class for JSPrnrnAn error occurred at line: -1 in the jsp file: nullrnrnGenerated servlet error:rn [javac] Compiling 1 source filernrnC:\Tomcat\work\Catalina\192.168.1.27\_\org\apache\jsp\index_jsp.java:7: cannot access java.lang.Objectrnbad class file: C:\Java\jre\lib\rt.jar(java/lang/Object.class)rnclass file has wrong version 49.0, should be 48.0rnPlease remove or make sure it appears in the correct subdirectory of the classpath.rnpublic final class index_jsp extends org.apache.jasper.runtime.HttpJspBasern ^rn1 errorrnrnrn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:83)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:306)rn org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:398)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:441)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)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:810)rn filters.CheckLoginTimoutFilter.doFilter(CheckLoginTimoutFilter.java:57)rn filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.0.24 logs.rnrn

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

07-19

错误[code=Java]2010-7-19 0:49:30 org.apache.catalina.core.ApplicationDispatcher invokern严重: Servlet.service() for servlet jsp threw exceptionrnorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 36 in the generated java filernSyntax error, insert "" to complete ClassBodyrnrnAn error occurred at line: 5,179 in the generated java filernSyntax error, insert "" to complete BlockrnrnAn error occurred at line: 5,179 in the generated java filernSyntax error, insert "" to complete BlockrnrnAn error occurred at line: 5,190 in the generated java filernSyntax error on token "", delete this tokenrnrnStacktrace:rn at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)rn at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)rn at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)rn at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)rn at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)rn at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.baidu.manageSystem.common.filter.EncodingFilter.doFilter(EncodingFilter.java:32)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:619)rn2010-7-19 0:49:30 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet action threw exceptionrnorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 36 in the generated java filernSyntax error, insert "" to complete ClassBodyrnrnAn error occurred at line: 5,179 in the generated java filernSyntax error, insert "" to complete BlockrnrnAn error occurred at line: 5,179 in the generated java filernSyntax error, insert "" to complete BlockrnrnAn error occurred at line: 5,190 in the generated java filernSyntax error on token "", delete this tokenrnrnStacktrace:rn at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)rn at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)rn at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)rn at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)rn at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)rn at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.baidu.manageSystem.common.filter.EncodingFilter.doFilter(EncodingFilter.java:32)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:619)[/code]

求救:Unable to compile class for JSP

03-08

[b]错误信息:[/b]rnorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 29 in the jsp file: /adjust.jsprnrequset cannot be resolvedrn26: %>rn27: rn29: String tempname=requset.getParameter("un");rn30: String temppass=request.getParameter("ps");rn31: tempname=change(tempname);rn32: temppass=change(temppass);rnrnrnStacktrace:rn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)rn org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)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)rn[code=Java]rnrn rn Untitled Documentrn rn rn <%!rn public String change(String a)rn rn tryrn rn String temp=a;rn byte[] temp2=temp.getBytes("ISO8859-1");rn String temp3=new String(temp2);rn return temp3;rn rn catch(Exception e)rn rn rn return"null";rn rn %>rn <%rn String username="admin";rn String password="admin";rn %>rn rn <%rn String tempname=requset.getParameter("un");rn String temppass=request.getParameter("ps");rn tempname=change(tempname);rn temppass=change(temppass);rn if(tempname.equals("admin")&&temppass.equals("admin"))rn rn session.putValue("un",tempname);rn response.sendRedirect("choose.jsp");rn rn elsern rn response.sendRedirect("relogin.jsp");rn rn %>rn rn rn[/code]

急,Unable to compile class for JSP

09-09

代码没有问题,在别的机器可运行,在新机器上部署就出问题了,是个登陆页面,登陆后显示错误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: 65 in the jsp file: /login_do.jsprnGenerated servlet error:rnD:\tool\New Folder\tomcat\tomcat\webapps\RBT\work\org\apache\jsp\login_005fdo_jsp.java:121: unreachable statementrn out.write("\r\n");rn ^rn1 errorrnrnrnrn 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

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