Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat JSP issue

 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have posted this question to the new JSP list, but I hope it's ok to reference the same question here. I have searched the archives of both lists for this exact question and didn't see an answer...
I have installed both Orion and Tomcat on my Win2000 machine. Orion is working great for servlets and JSPs, but Tomcat is only processing servlets--even the example JSPs they give throw the error described here: http://www.javaranch.com/ubb/Forum50/HTML/000012.html
All of my environmental variables (well, both of them) are good, and the server is running, it's just not happy processing JSP pages for some reason. I have played with it for awhile to no avail. I can use Orion, but they are not supporting the latest and greatest JSP release yet (although I am enough of a newbie at JSP to not completely know what I would be missing there, I think it's probably best to use what the gurus are using )
Thanks!
--liz
------------------
Elizabeth Lester
Sun Certified Programmer for the Java� 2 Platform
[This message has been edited by Elizabeth Lester (edited October 24, 2001).]
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
I had same problem, but I could not figure it out. I took different approach to learn JSP. Who knows you might like it. Follow the link.
[URL=http://www.javaranch.com/ubb/Forum7/HTML/006232.html[/URL]
You like it or not either way good luck. If you solve this problem how to run JSP in tomcat4 let us know. BK

All of my environmental variables (well, both of them) are good, and the server is running, it's just not happy processing JSP pages for some reason. I have played with it for awhile to no avail.

 
Lee Xu
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, You can go to Servlet forum to search "Tomcat". There are a lot of advices regarding Tomcat there. Good luck!
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops! URL not working. Try ii.
=http://www.javaranch.com/ubb/Forum7/HTML/006232.html
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops! URL not working. Try it.
http://www.javaranch.com/ubb/Forum7/HTML/006232.html

 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bal and Lee.
I had read that other post but it looked like a slightly different error than the one I am getting.
Is it appropriate, then, to work toward the SCWCD with something that supports less than Servlets 2.3 and JSP 1.2? Or is that just a pipe dream for now?
I have Orion 1.5.2, which supports Servlets 2.3 but JSP 1.1.
Tomcat 3.2.3 supports Servlets 2.2.
Would it be a mistake to not be working with a container that supports the latest at least of the Servlet spec? Or can we make up the difference from reading about the latest improvements?
Thanks for indulging a newbie!
Cheers,
Liz
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Upto this point I have not seen any extra features that is not handled by tomcat3.2.3. It is possible that I don't have enough understanding to distinguish strength between tomcat3.2.3 and 4.0.
I did not like to get stucked for writing simple jsp. That is the reason why I picked up tomcat3.2.3. At least I don't have to pull my hair and bite nails to figure out why it did not work?
LIZ your question is heavy for me. If anybody out there using tomcat4.0 for jsp let us know we will follow their path. BK

Would it be a mistake to not be working with a container that supports the latest at least of the Servlet spec? Or can we make up the difference from reading about the latest improvements?

 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll definitely let you guys know if I ever figure out the problem. I have also posted this question to the JSP forum, but have not gotten any responses yet.
Thanks,
Liz
 
Tim Duncan
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, no ideas. Tomcat works fine for me on Win2000. I can only assume that it is some interaction with (a) Orion, (b) an earlier version of Tomcat?, (c) an earlier JDK? .. you are using JDK 1.3 or above?
It seems to be suggesting that there's an exception being thrown by Servlet.init() .... Is it always the same error?
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Duncan:
Sorry, no ideas. Tomcat works fine for me on Win2000. I can only assume that it is some interaction with (a) Orion, (b) an earlier version of Tomcat?, (c) an earlier JDK? .. you are using JDK 1.3 or above?
It seems to be suggesting that there's an exception being thrown by Servlet.init() .... Is it always the same error?

Hi Tim,
I am using JDK 1.3 and have no previous installations of Tomcat. Which version of Tomcat are you using?
I was consulting with my fellow geeks here at work, who think that a conflict with Orion (while it's not running) would be unlikely--but what do they know?
If you are successfully using the latest Tomcat release, I would be tempted to uninstall both servers and start from scratch...
--liz
p.s. And yes, it is always the same error:

exception
javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception.....
root cause
java.lang.NoSuchMethodError.....

[This message has been edited by Elizabeth Lester (edited October 25, 2001).]
 
Tim Duncan
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bizarre ... why this error only with JSPs not servlets ...
I'm using Tomcat 4.0 (I believe there's a 4.0.1 now). You need 4.0 or above to get the features of JSP 1.2 and Servlet 2.3
If you have the option to uninstall Orion that'd probably be the easiest option.
If you fancy delving into the problem, try looking in the directories under $TOMCAT_HOME/work/$HOSTNAME/examples/jsp/ (where $HOSTNAME is most likely "localhost")
This is where Tomcat puts the servlets that it created from the JSP examples. For example: the snp directory should contain snoop$jsp.java and snoop$jsp.class files if you have tried the Snoop example.
You might also want to look in the logs ($TOMCAT_HOME/logs/$HOSTNAME_log.$DATE.txt, where $DATE is of the form 2001-10-25) to see if there's are any clues there.
HTH

[This message has been edited by Tim Duncan (edited October 25, 2001).]
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Duncan:
Tomcat 4.0 (I believe there's a 4.0.1 now). You need 4.0 or above to get the features of JSP 1.2 and Servlet 2.3


Exactly!
If you fancy delving into the problem, try looking in the directories under $TOMCAT_HOME/work/$HOSTNAME/examples/jsp/ (where $HOSTNAME is most likely "localhost")
This is where Tomcat puts the servlets that it created from the JSP examples. For example: the snp directory should contain snoop$jsp.java and snoop$jsp.class files if you have tried the Snoop example.
You might also want to look in the logs ($TOMCAT_HOME/logs/$HOSTNAME_log.$DATE.txt, where $DATE is of the form 2001-10-25) to see if there's are any clues there.

Oh, I fancy it
The only file in my $TOMCAT_HOME/work/$HOSTNAME/examples/ directory (there are no subdirectories showing up there) is SESSIONS.ser...
In my localhost log from today I see the error I reported above, but prior to it there's another one:

2001-10-25 10:15:34 jsp: init
2001-10-25 10:15:35 StandardContext[/examples]: Servlet /examples threw load() exception


Which might be why there are no subdirectories under work/examples?
I'm starting to think it's got to be something simple. Did you do anything super-special when you installed your Tomcat?
Thanks,
Liz

[This message has been edited by Elizabeth Lester (edited October 25, 2001).]
 
Tim Duncan
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Elizabeth Lester:
Did you do anything super-special when you installed your Tomcat?

No, just unzipped it, set CATALINA_HOME (JAVA_HOME was already set), and ran it.
Originally posted by Elizabeth Lester:
Which might be why there are no subdirectories under work/examples?

So we know that it didn't even succeed in translating the JSP to a servlet. It's not a problem with write permissions on the directory, is it?
 
Gaja Venkat
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Liz:
Please check if you are using a stable release of Tomcat 4.0 I do not know much about Orion, but may be you could uninstall it and install Tomcat all over again.
All the Best,
--------------------------------------------
Gaja Venkat
Sun Certified Programmer for Java 2 Platform
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Duncan:
So we know that it didn't even succeed in translating the JSP to a servlet. It's not a problem with write permissions on the directory, is it?

Unfortunately not.
All of the web applications (examples, manager, and lizapp--which I added) are throwing the same load() error as above.
I am going to remove Orion now and see what happens.
--liz
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gaja Venkat:
Hi Liz:
Please check if you are using a stable release of Tomcat 4.0 I do not know much about Orion, but may be you could uninstall it and install Tomcat all over again.
All the Best,

I think it is a stable release. It's version 4.0.1 that I downloaded from http://jakarta.tomcat.org/builds/jakarta-tomcat-4.0.1/release directory.
I have removed both servers and now I am going to try installing Tomcat 4.0 and perhaps reinstalling 4.0.1...
Wish me luck!
p.s. These are my environmental vars just to double check: JAVA_HOME: C:\jdk1.3
CATALINA_HOME: C:\jakarta-tomcat-4.0.1
is there anything I am supposed to be indicating about my C:\j2sdkee1.3 directory? Am I a newbie of the rarest form?
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I removed both servers and reinstalled Tomcat 4.0.1 and got the same error.
Then I downloaded and installed Tomcat 4.0 just for ha-has, and it gives this error:
org.apache.jasper.JasperException: Unable to compile class for JSP if (pageContext != null) pageContext.handlePageException(t);

Does that give us any more information?
Jasper should just be ready to go when you install Tomcat, right?
I appreciate everyone's help with this. I just found someone posted the same problem on JGuru site just yesterday. If no one has any more ideas, I promise I will reinstall Orion and call it a day
Thanks,
Liz
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can sense how you feel when you cann't install properely software to run it. I was sleepless about a week. I have both tomcat4.0 and tomcat3.2.3 in my machine. I tested all tomcat servlet examples in tomcat4, they worked super. I wrote few mine ran without any glitch.
When I step forward to JSP section, oh! boy nightmare started. I felt myself stupid that cann't install software. I tested all tomcat JSP examples only NUMGUESS worked. OhHo! I felt little better. I decided to use tomcat3.2.3 as suggested by one of the RANCHER. OK, I am doing good. But I am not happy though still, I am interested to know why JSP pages did not work for me using tomcat4.0? BK
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's good to know that I am not alone, at least
For those who have successfully prepared for and passed the SCWCD, has anyone done it with Tomcat 3.x or Orion 1.5.x? I'm not clear yet on what the differences are between Servlet and JSP versions, and I just want to make sure to set up the best environment for preparing for the exam.
Thanks,
Liz
[This message has been edited by Elizabeth Lester (edited October 25, 2001).]
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have finally corrected the problem! What a happy Friday!
I still don't know what the cause was exactly, but I removed everything from my machine--all of the servers, and the JDK (which I had not tried reinstalling yet--thank you Tim!), and reinstalled it all from scratch and I now have Tomcat 4.0.1 running JSPs!
Thank you so much to everyone who made suggestions. I don't know what was wrong with my previous JDK, I guess I must have inadvertently moved or removed a file or something. Reinstalling it did the trick. Who'd've thought? (Well, other than Tim, that is )
Cheers,
Liz
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LIZ:
Rock and roll now. Next week I will uninstall all my tomcatXXX plus jdk1.3. Download fresh one and reinstall it. Leet see what's gonna happen? I will give a try. I am kinda busy this week. GOOD LUCK.
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right on. Here's hoping it works for you too! Good luck! --liz
 
Gaja Venkat
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Liz:
Good to know that the problem with Tomcat running JSP is solved now! Though I was thinking that removing all the servers and then re-installing Tomcat alone may work, the idea of re-installing JDK did not occur to me at all!
Best Wishes,
Gaja Venkat
Sun Certified Programmer for Java 2 Platform
 
Tim Duncan
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Re-booting after un-installing is also important, as "odd stuff" may still hang around on Windows, and you don't get a clean install. Of course this isn't a problem if you run Linux

 
Thomas Whalen
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bal Sharma,
normally i don't reply to messages with a certain person targeted, out of fear that i will hurt someone else's feelings. we are all important here, great knowledge of Java or none.
anyway, here is my dilemma. i have Tomcat 4.0 working, am able to try and successfully use the JSP examples and Servlet examples on Tomcat 4.0 ...please either post some very simple code for me to copy and use on my machine (per your instructions) or point me to a very simple tutorial on JSP or Servlets for Tomcat 4.0 ...i am not using IIS, just use http://localhost and it brings up the JSP and Servlet examples.
thank you,
Thomas
 
Nasser Aboobaker
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I think I am late slightly..
I had the same problem with my Tomcat 4.0 installation. Servlets works fine. JSP throws error. Posted several queries. Atlast experimented and found the solution. Either set your path to point to tools.jar(which is in your Java.lib) or copy the tools.jar to your tomcat installation lib folder. It worked fine with me.
Nasser
 
Eduardo Pereira
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Had the same problem, finally found my solution: servlet.jar was in directory JAVA_HOME\jre\lib\ext\, and apparently Tomcat took it from there (that jar was from servlet specs 2.2 I think). When I deleted that file JSPs ran OK.
Thanks for all your help from 2 months ago
Good luck to all
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic