Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can not compile JSP

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I successfully deploy an application but failed to view the welcome JSP page. I got this error

****
org.apache.jasper.JasperException: Unable to compile class for JSP
...
Compile failed; see the compiler error output for details.
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:409)
******

I further checked the generated java code for that jsp, it looks like

**************
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {

....
******************

Env: I am using sun system application server. Questions

1) why it is using apache jasper compiler ?

2) what can be wrong ? The jsp is nothing but a greeting page.
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2) what can be wrong ? The jsp is nothing but a greeting page.

Can we see that?
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Pandya wrote:
2) what can be wrong ? The jsp is nothing but a greeting page.

Can we see that?


<html>
<body> Hello World ! </body>
</html>
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj Ohadi wrote:
Compile failed; see the compiler error output for details.

And?
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it was found that if I pre-compile the jsp on server during deployment, then the problem disappear. But if I don't pre-compile, the problem persists. Any idea why ? I checked the app server spec, there is not such pre-requiste for deployment.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the compiler failure output that Bauke requested? We can't do a thing to help you without it.
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Where is the compiler failure output that Bauke requested? We can't do a thing to help you without it.


It just shows it can not compile the JSP whenever I run the application and involves any JSP. It deploys the application well though.

But if I pre-compile the JSP when I deploy the app, then I don't see any of such errors when I run the application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic