• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Servlets work, JSPs do not...

 
Ranch Hand
Posts: 141
  • 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!
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • 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 VI Editor Redhat
  • 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
  • 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!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!