• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

can not compile JSP

 
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.
 
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>
 
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.
 
Marshal
Posts: 67366
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
It was the best of times. It was the worst of times. It was a tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!