jsp pages in tomcat
Hello,
I've recently downloaded and installed Tomcat 6.0.10 and am trying to open html and jsp pages.
My server is running: When I open http:\\localhost\ in a browser, I get the default Apache Tomcat page.
I placed 2 test pages (Hello.html and Hello.jsp) in install_dir/webapps/ROOT and can successfully access the html page.
However, when I try to access the jsp page, I receive a status 500 error message, with root cause stating, "java.lang.NoClassDefFoundError: javax/servlet/Servlet"
I am afraid that Tomcat doesn't know where the JDK is installed on my machine. I already set JAVA_HOME to "C:\Program Files\Java\jdk1.6.0_01" (I am using Windows XP and did this by setting the environment variable in System > Advanced Tab > Environment Variables button > then set the value and variable under "System variables".
Is there something else I need to do to get the server to know where the compiler is located?
Thank you, -lola
[989 byte] By [
lolaa] at [2007-11-27 4:44:12]

# 1
java.lang.NoClassDefFoundError: javax/servlet/Servlet
This class is not part of the standard JDK. It is part of J2EE.
It ships as a standard part of Tomcat in the [TOMCAT]/common/lib/servlet-api.jar file.
Your JAVA_HOME configuration looks correct. It is not the source of this error.
Can you post your Hello.jsp page here?
Are you referring to javax.servlet.Servlet within that page?
# 3
Thanks for responding!
I already have both
C:\apache-tomcat-6.0.10\lib\servlet-api.jar
and
C:\apache-tomcat-6.0.10\lib\jsp-api.jar
added to my CLASSPATH
When I try to access my test JSP page, I receive the following status 500 error message:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/Servlet
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NoClassDefFoundError: javax/servlet/Servlet
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
Also, interestingly, I think the cause of the problem is stated bluntly in the cmd-line interface when I start-up Tomcat. A message displays stating:
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path.
What is the java.library.path? How can I add C:\apache-tomcat-6.0.10\lib\
to it? I think this would probably solve the problem...
thank you,
lola
lolaa at 2007-7-12 9:56:07 >
