aspose file tools
The moose likes JSP and the fly likes jasper Exception: unable to compile JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "jasper Exception: unable to compile JSP" Watch "jasper Exception: unable to compile JSP" New topic
Author

jasper Exception: unable to compile JSP

hari vemulapalli
Greenhorn

Joined: Mar 17, 2008
Posts: 18
Hi

I have a simple Jsp page and Iam using sunone server . after I deploy my dynamic web application in sun one and try to access that simple jsp i am getting the

following Error. My jsp has just body sayiing this is my first Jsp...

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

Do I need to set any path for this??? And the Server is not in my local machine.

Any one please help me to solve this.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35242
    
    7
My guess would be that either not all required jar files are in the WEB-INF/lib directory, or that the JSP is missing an import statement. The complete error message (and stack trace) should mention what's going wrong.


Android appsImageJ pluginsJava web charts
hari vemulapalli
Greenhorn

Joined: Mar 17, 2008
Posts: 18
Thanks for the reply...
Here is the stacktrace
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
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:101)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:448)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:506)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:485)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:473)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:516)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)


root cause

Error running /usr/jdk/instances/jdk1.5.0/bin/javac compiler
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:473)
org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.java:47)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:931)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:409)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:506)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:485)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:473)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:516)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)


note The full stack trace of the root cause is available in the Sun-Java-System/Application-Server logs.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35242
    
    7
Do other JSP pages work?
hari vemulapalli
Greenhorn

Joined: Mar 17, 2008
Posts: 18
None of the jsps are working. But if I change the file extention from jsp to html and deploy that it s working fine.
None of the jsps in my web application are working. i am using Eclipse editor. This is because of missing jar files I suppose as I am trying to access simple jsp that has <html> and <body> tags. previously it was working . suddenly it started giving this error.all the jar files are under project/Buildpath /configure buildpath/Libraries in Eclipse.
should we have any jars under web-inf/lib directory....
without having the jars under lib i could access my application previously.
please suggest me
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35242
    
    7
If no JSPs work then it's unlikely to be a matter of missing classes or jar files. The message sounds as if the servlet container is not set up correctly with a compiler (which it needs for running JSPs).

Is this a standalone Tomcat, or is it somehow integrated with Eclipse?
hari vemulapalli
Greenhorn

Joined: Mar 17, 2008
Posts: 18
I am using Sun One Server and thats not running on my local machine.
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
Can it be an OS permissions issue as it is not able to invoke javac?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jasper Exception: unable to compile JSP
 
Similar Threads
Regarding project deployment in tomcat
caching
Unable to compile jsp's
Limit of JSP page to Compile
where's my class?