Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Unable to load JSP classes(Constant error messages in Tomcat)
Unable to load JSP classes [message #515709] Fri, 19 February 2010 16:00 Go to next message
Sam is currently offline Sam
Messages: 1
Registered: July 2009
Junior Member
Hey All-

I've been using Eclipse + WTP for a couple of years now, and just recently moved to using Tomcat 6 on my development machine.

Lately, I've been getting a *ton* of exceptions of this sort:

"org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP". The pages aren't always the same, and don't have any sort of compilation issue.

I can fix the errors by clearing the work directory from within Eclipse, but it always reappears fairly quickly. I'm pretty sure this has something to do with auto-deployment, because i can export a WAR and deploy it by hand (on Tomcat, and also on my production GlassFish installation) without issues.

Has anyone ran into this, and managed to find a fix? Its not really that big of a deal, but its starting to get pretty irritating having to hand clear the directories so often.

Thanks for any help!
Re: Unable to load JSP classes [message #516019 is a reply to message #515709] Mon, 22 February 2010 09:05 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1287
Registered: July 2009
Senior Member
Sam wrote:
> Hey All-
>
> I've been using Eclipse + WTP for a couple of years now, and just
> recently moved to using Tomcat 6 on my development machine.
>
> Lately, I've been getting a *ton* of exceptions of this sort:
>
> "org.apache.jasper.JasperException: org.apache.jasper.JasperException:
> Unable to load class for JSP". The pages aren't always the same, and
> don't have any sort of compilation issue.
> I can fix the errors by clearing the work directory from within Eclipse,
> but it always reappears fairly quickly. I'm pretty sure this has
> something to do with auto-deployment, because i can export a WAR and
> deploy it by hand (on Tomcat, and also on my production GlassFish
> installation) without issues.
>
> Has anyone ran into this, and managed to find a fix? Its not really that
> big of a deal, but its starting to get pretty irritating having to hand
> clear the directories so often.
>
> Thanks for any help!

This isn't something I've seen. Unfortunately, the exception provides
no clue as to why the class can't be loaded. This is likely due to some
underlying exception nested in this one. Are there any "caused by"
exceptions listed as well? You could try to set an exception breakpoint
for JasperException and run in debug mode. When this exception gets
created and execution breaks, you may be able examine the variables and
code locations involved to determine the root cause.

Cheers,
Larry
Re: Unable to load JSP classes [message #550276 is a reply to message #515709] Thu, 29 July 2010 13:30 Go to previous messageGo to next message
Tony  is currently offline Tony
Messages: 4
Registered: June 2010
Junior Member
I'm seeing this a ton as well....I'm running OSX, Ganamede, tomcat 6.0.20. Same solution. Doing a clean fixes it.

I also run with "no publishing", but instead have it serve without publishing...I think the serve w/o publishing is the key parameter, but turning that off makes debugging a pain in the butt, since it clears the session any time I touch a java file.

It is a little difficult to reproduce, but I suspect reproducing it requires something like:

Configure WTP tomcat server instance to serve without publishing (and never publish automatically).

1. Start the webapp (which takes about 15 seconds to completely load...this delay may be necessary)
2. Access a page
3. Restart the webapp. While it is loading, try to access the page from (2). Get service temp unavail.
4. Try to use the page once it is up.

Get exception:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspSe rvletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServl etWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServl et.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java :267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationC ontext.java:620)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspSe rvletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServl etWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServl et.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java :267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

java.lang.ClassNotFoundException: org.apache.jsp.Home_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:202)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoade r.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoade r.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationC ontext.java:618)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspSe rvletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServl etWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServl et.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java :267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

[Updated on: Thu, 05 August 2010 10:47]

Report message to a moderator

Re: Unable to load JSP classes [message #646071 is a reply to message #515709] Tue, 21 December 2010 15:03 Go to previous message
Chris is currently offline Chris
Messages: 1
Registered: December 2010
Junior Member
Same problem here. Just wondering if anyone has figured out how to avoid this problem?
Previous Topic:top down POJO Web Service
Next Topic:JSP/XHTML on classpath triggers Tomcat Restart
Goto Forum:
  


Current Time: Sat Apr 19 00:30:12 EDT 2014

Powered by FUDForum. Page generated in 0.06540 seconds