| Author |
Servlets work, JSPs do not...
|
Chris Montgomery
Ranch Hand
Joined: Jan 14, 2004
Posts: 141
|
|
Just installed Tomcat 5.5.25: $JAVA_HOME = /usr/java/jdk1.5.0_14/ $JRE_HOME = /usr/java/jre1.5.0_14/ $TOMCAT_HOME = /var/lib/tomcat5/ java and jre bin directories are in my $PATH my java engine is set to: Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03) rather than the default used by Fedora 8. Tomcat manager works great. running sample war from apache samples and the servlet works great, however, when I click on the jsp link, I get the following error (happens when I click on the axis2 link as well...): An error occurred at line: 1 in the generated java file The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files JSP FileName:null Java FileName:/usr/share/tomcat5/work/Catalina/localhost/sample//org/apache/jsp/hello_jsp.java .... An error occurred at line: 1 in the jsp file: /hello.jsp The method write(String) is undefined for the type JspWriter 1: <html> 2: <head> 3: <title>Sample Application JSP Page</title> 4: </head> JSP FileName:/hello.jsp Java FileName:/usr/share/tomcat5/work/Catalina/localhost/sample//org/apache/jsp/hello_jsp.java and so on... Let me know if I can provide any more detail on this. Thanks!
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Make sure the user under which Tomcat is running has permissions to read and write to the tomcat/work directory. This is the directory where the generated servlet code and class files resulting from JSP compilation go.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
Tomcat also needs to be able to write to the tomcat/logs directory.
|
 |
Chris Montgomery
Ranch Hand
Joined: Jan 14, 2004
Posts: 141
|
|
Thanks Ben!!! It was completely permissions based. I updated the permissions on various tomcat5 directories: (chown -R tomcat.tomcat <directory path>) /var/lib/tomcat5/ /usr/share/tomcat5/ /var/cache/tomcat5/ /var/log/tomcat5/ I did the same for the /etc/sysconfig/tomcat5 and /etc/tomcat5/tomcat5.config files. I also commented out the JAVA_HOME being set in both of these files, since they were pointing to the default java that was installed with Fedora Core 8 rather than the one I set in /etc/profile I also cleaned out /var/cache/tomcat5 (work directory). Restarted Tomcat and it all worked. Thanks again!
|
 |
 |
|
|
subject: Servlets work, JSPs do not...
|
|
|