File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlets work, JSPs do not...

 
Chris Montgomery
Ranch Hand
Posts: 141
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat also needs to be able to write to the tomcat/logs directory.
 
Chris Montgomery
Ranch Hand
Posts: 141
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic