Unable to load class for JSP

I'm using Intellij 8.1.3, Tomcat 6.0.20, JDK 1.6.0_13.

The java file is placed in src folder:

src/javafile.java

In the web folder, I have the jsp file

<jsp:useBean id="bla" scope="page" class="javafile" />


I receive this error from Tomcat:

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(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.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(JspCompilationContext.java:620)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.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.index_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.




What is the problem?

2 comments
Comment actions Permalink

placing the class in root package?

Blair Tes wrote:

I'm using Intellij 8.1.3, Tomcat 6.0.20, JDK 1.6.0_13.

The java file is placed in src folder:

src/javafile.java

In the web folder, I have the jsp file
<jsp:useBean id="bla" scope="page" />


I receive this error from Tomcat:

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(JspServletWrapper.java:156)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.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(JspCompilationContext.java:620)
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.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.index_jsp
> java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> java.security.AccessController.doPrivileged(Native Method)
> java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
> org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
> org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.
>




What is the problem?

---
Original message URL: http://www.jetbrains.net/devnet/message/5243753#5243753



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Pretty new to the Java scene

"root package "?

Anw...

I have created a package for my java file, but the same problem.

P.S. And if I hit the refresh button, I receive:

The value for the useBean class attribute packagename is invalid.
0

Please sign in to leave a comment.