my dog learned polymorphism*
The moose likes Tomcat and the fly likes Tomcat  4.1.12 not executing JSP on Sun OS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat  4.1.12 not executing JSP on Sun OS" Watch "Tomcat  4.1.12 not executing JSP on Sun OS" New topic
Author

Tomcat 4.1.12 not executing JSP on Sun OS

Shilpa Bhargava
Ranch Hand

Joined: Sep 15, 2002
Posts: 39
Hi,
I have a weird problem !
My application runs fine on Apache 2.0 and Tomcat 3.3.1 on Windows
Now I have moved the same code on to SunOS 5.6. which has APache2 and Tomcat 4.1.12. I am able to excute Tomcat's examples jsps and servlets !But when it comes to my own application deployed on the Root, when I try to run my jsp, Tomcat shows a prompt asking if I want to download the file...and then it shows the entire jsp code !!! instead of executing it.....
Can't understand the problem... Can ne one help....
[ October 28, 2002: Message edited by: Shilpa Bhargava ]
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Try to delete the work directory under tomcat and try again to execute example jsp's. if its not working then check the logs directory for error messages or the command window.
Jesse Beaumont
Ranch Hand

Joined: May 30, 2002
Posts: 43
Hi,
I don't know whether this is the same problem, but tomcat 4.1 and tomcat 3.3 behave quite differently (not least because they implement different servlet and jsp specifications). I have found that tomcat 4 no longer enables the default servlet and jsp handler automatically, so you either have to define those, or you have to specify a servlet-mapping in the web.xml for each servlet/jsp you want to run.
Hope that helps.
Jesse


---<br />Time flies like an arrow,<br />Fruit flies like a banana
satya uppaluri
Greenhorn

Joined: Oct 16, 2002
Posts: 21
Hi Jesse,
you are correct. Actually the container from 4.0 onwords is called catalina. It is completely rewritten as per new spec.
regarding silpa's problem, it looks like apache is not sending the jsp requests to Tomcat. it is handling the request itself. is there any mapping is missing in apache configuration?.
but then how is examples running allright?.
Shilpa Bhargava
Ranch Hand

Joined: Sep 15, 2002
Posts: 39
In my Apache's httpd.conf
this is what is appended
<IfModule mod_jk.c>
JkWorkersFile "/usr/local/jakarta-tomcat-4.1.12/conf/jk/workers.properti
es"
JkLogFile "/usr/local/karta-tomcat-4.1.12/logs/mod_jk.log"
JkLogLevel debug
JkMount /examples ajp13
JkMount /examples/* ajp13
JkMount /jk ajp13
JkMount /jk/* ajp13
JkMount /cocoon ajp13
JkMount /cocoon/* ajp13
## JkMount /ROOT ajp13
## JkMount /ROOT/* ajp13
</IfModule>
Cud the problem be becoz ROOT entry is commented ???
Shilpa Bhargava
Ranch Hand

Joined: Sep 15, 2002
Posts: 39
Jesse,
Are u talking about uncommenting the mapping for invoking servlet ?
Is there anything else also that needs to be uncommented or added to the web.xml file !!

Thanks a ton !
Shilpa Bhargava
Ranch Hand

Joined: Sep 15, 2002
Posts: 39
Uncommenting the ROOT entry worked ....but now the error is 404 for ROOT!!!
Jesse Beaumont
Ranch Hand

Joined: May 30, 2002
Posts: 43
Hi,
Defining a mapping for the invoker servlet is one option. The other option is to add a servlet-mapping tag to your web.xml for every servlet you have.
e.g.
<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/servlet/HelloWorldServlet</url-pattern>
</servlet-mapping>
Hope that clarifies it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 4.1.12 not executing JSP on Sun OS