Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Rahul Chhangani
Greenhorn
Posts: 12
Chrome Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i compiling the jsp file...this error occured....
how to resolve this...



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: Unable to compile class for JSP:

An error occurred at line: 82 in the generated java file
Syntax error on token "catch", Identifier expected

An error occurred at line: 84 in the generated java file
out cannot be resolved to a variable

An error occurred at line: 84 in the generated java file
_jspx_out cannot be resolved to a variable

An error occurred at line: 85 in the generated java file
out cannot be resolved to a variable

An error occurred at line: 85 in the generated java file
out cannot be resolved

An error occurred at line: 86 in the generated java file
out cannot be resolved

An error occurred at line: 87 in the generated java file
_jspx_page_context cannot be resolved to a variable

An error occurred at line: 87 in the generated java file
_jspx_page_context cannot be resolved

An error occurred at line: 89 in the generated java file
Syntax error on token "finally", { expected

An error occurred at line: 90 in the generated java file
_jspx_page_context cannot be resolved to a variable

Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:95)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:342)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.10 logs.

Apache Tomcat/7.0.10
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a syntax error in the JSP that you did not show us.

From that it is also clear that you are putting Java code in your JSP. You do realize that that is a bad and obsolete practice from about 12 years ago, right? See this JspFaq entry.
 
Rahul Chhangani
Greenhorn
Posts: 12
Chrome Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thats my jsp code....its simple connectivity code...
i used it previous and it works fine......this time after re installation pf system...it give me error


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem you are having is one of the very many many reasons that Java code in a JSP is obsolete and should never be used. You should not have this code in a JSP. Consider adopting modern practices and moving this code into a Java class where it belongs.

That said, look carefully at the code of line 10.
 
Manas Saxena
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
catch without try.
I think thats the problem
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That and many syntax errors. Which are tough to avoid when writing JSPs with Java code.
 
Rahul Chhangani
Greenhorn
Posts: 12
Chrome Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks now code working....its try catch problem....
and seriously thanks for guiding me to how to code java and jsp...
-now i'll separate java, jsp in the code, i'll use best practices coding java web application
--
last question is can any one suggest me best online tutorial for java pattern design, hibernate, struts, spring,
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The sites for all of those technologies have tutorials. All you've got to do is look for them.
 
Rahul Chhangani
Greenhorn
Posts: 12
Chrome Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks...
i'll visit....
and again thanks to all guys...for support me and giving me such a instant reply.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!