• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error compiling JSP  RSS feed

 
J Abraham
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: 13 in the jsp file: /jsp/jibinjsp/MYWORK/OTHERS/variab.jsp

Generated servlet error:
[javac] Compiling 1 source file

/home/jibin/jakarta-tomcat-4.1.12/work/Standalone/localhost/examples/jsp/jibinjsp/MYWORK/OTHERS/variab_jsp.java:10: illegal start of type
--variab.jsp -- boolean isPasswordAnyGood(String password) {
^
/home/jibin/jakarta-tomcat-4.1.12/work/Standalone/localhost/examples/jsp/jibinjsp/MYWORK/OTHERS/variab_jsp.java:14: expected
private static java.util.Vector _jspx_includes;
^
/home/jibin/jakarta-tomcat-4.1.12/work/Standalone/localhost/examples/jsp/jibinjsp/MYWORK/OTHERS/variab_jsp.java:17: cannot resolve symbol
symbol : variable _jspx_includes
location: class org.apache.jsp.variab_jsp
return _jspx_includes;
^
/home/jibin/jakarta-tomcat-4.1.12/work/Standalone/localhost/examples/jsp/jibinjsp/MYWORK/OTHERS/variab_jsp.java:51: cannot resolve symbol
symbol : method isPasswordAnyGood (java.lang.String)
location: class org.apache.jsp.variab_jsp
if(isPasswordAnyGood("somePhoneyPassword")) {
^
4 errors


at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:313)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:471)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)

The JSP Code is :

<HTML>
<HEAD>
</HEAD>
<BODY>

<%! boolean isPasswordAnyGood(String password) {
return false;
}
%>
<% if(isPasswordAnyGood("somePhoneyPassword")) {
%> <H1> Welcome to JAVA TECHNOLOGY <H1>
<% } else {
%> <H1> Please Login </H1>
<% }
%>
</BODY> </HTML>

How could i resolve this problem. i am little confused as i am beginner.
[ June 25, 2004: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch, Jibin.

Did you take a look at the variab_jsp.java file that Tomcat created on behalf of your JSP? That might give you some clues as to what the compiler doesn't like.

If it doesn't leap out at you, you might want to post the relevant portions of that file here for us to look at (please, not the whole file, and please use the UBB code tags to preserve formatting).

A few other administrative things:

1) "Pls help me" is not a very useful topic subject. You will note that I have edited it for you to something that's a bit more descriptive. You will find that topics that have descriptive subjects get more attention.

2) Also, your display name is in all uppercase. Not very friendly. Look at the other names in the forum and you will see that mixed case is much easier to read. I'd suggest you edit your display name accordingly. It's just a friendlier thing to do.
 
J Abraham
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben....

The JSP Code is
<HTML>
<HEAD>
</HEAD>
<BODY>

<%! boolean isPasswordAnyGood(String password) {
return false;
}
%>
<% if(isPasswordAnyGood("somePhoneyPassword")) {
%> <H1> Welcome to JAVA TECHNOLOGY <H1>
<% } else {
%> <H1> Please Login </H1>
<% }
%>
</BODY> </HTML>

and i am getting that Jasper Exception.Hope you could clear my error soon.Thanx for the advice.The Tomcat Server is running now. and i am running the Tomcat server in Linux.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not exactly what I meant.

As you may (or may not) know, Tomcat will create a Servlet out of your JSP page, then compile it and that is what gets executed when the JSP runs. In this instance, that file is /home/jibin/jakarta-tomcat-4.1.12/work/Standalone/localhost/examples/jsp/jibinjsp/MYWORK/OTHERS/variab_jsp.java according to the error message.

Taking a look at that file may tell you (or us) what the issue might be,

P.S. Your code example works perfectly fine for me.
[ June 25, 2004: Message edited by: Bear Bibeault ]
 
J Abraham
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben....
now it's working.

- jibiN
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben?

What did you change that solved the issue? Future readers that have a similar issue might benefit from your experience.
[ June 25, 2004: Message edited by: Bear Bibeault ]
 
J Abraham
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear Bibeault ,

i'm sorry that i mispelled your name.
The problem was with the Comment that i specified in this jsp page.i was not sure of writing comments in java.i just opened the file variab_jsp.java which was in /home/jibin/jakarta-tomcat-4.1.12/work/Standalone/localhost/examples/jsp/jibinjsp/MYWORK/OTHERS........
corrected the comment.Anyway JSP Debugging is interesting if people like you are there for help.
Thanks Bibeault.

- jibiN
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!