• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat newbie

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i'm new to Tomcat. Last time i ran a servlet was on jsdwk1.0.1..
I now have Tomcat 4.0.2 with jdk1.3.0. Are they compatible?
How do i run the example servlets that came with Tomcat?
Your feedback will be greatly appreciated.
 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This article is a good starting point. There are
more beginner articles related to Tomcat on this site.
Ravihttp://www.onjava.com/pub/a/onjava/2001/03/29/tomcat.html
 
Ranch Hand
Posts: 1246
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes.. they are compatible! and recommended!
The examples are there. After you start tomcat.
go to http://localhost:port/name_of_webapp/
thats it.
or just go to http://localhost:port/ it will have links to the examples that came with tomcat.



Edited by MC to remove smilies At the bottom of the form you fill out, there is a checkbox that says "disable smilies in this post". Use this when you have things like :P in your post (:port or jdbc urls are common)
[ March 10, 2002: Message edited by: Mike Curwen ]
 
Fei Ng
Ranch Hand
Posts: 1246
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure why the faces.
it is http://localhost: port/
no space with : and port. If i take out the space it will become a face.
good luck.
 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you both Fei and Ravi for replying.
I was missing the Tomcat_home environment variable. I managed to get the http://localhost:8080 to come up, but then i tried the servlet link on it i got

I also have Java_Home set up ( in short my jdk runs fine).. I followed the instruction on the website provided by Ravi and got stuck at that point where my link returned a 404.. ? the examples/servlet directly is there..
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by FEI NG:
I am not sure why the faces.

There's a checkbox at the bottom of the screen that let's you turn off smilies when posting. the combination of : and p turns into
 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am i supposed to modify the .xml file that is included in the installation? I cannot run the examples that came with Tomcat. I've got Tomcat_home, Catalina_home and java_home all set.. what else do i need to run the examples?

TIA
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, you shouldn't need to modify the web.xml or server.xml at all.

What do you have CATALINA_HOME and JAVA_HOME set at? It should be something like:
CATALINA_HOME=d:\program files\Apache Tomcat
JAVA_HOME=d:\jdk1.3.0

note that CATALINA_HOME does not include the bin subdirectory, and neither does JAVA_HOME.

Lastly, try it with all capital letters.
 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java_HOME is set to
e:\jdk1.3
CATALINA_HOME is set to
e:\program files\Apache Tomcat 4.0
Tomcat starts fine as i've changed the port number to 80 and i can still see the index page. I cannot access the examples via the links on the index page, however. I kept getting 404.
Your help would be greatly appreciated!
 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please, your assistance will be greatly appreciated.
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do the Tomcat logs say?
 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is what is in localhost_examples_log.2002-03-20.txt


2002-03-20 13:58:48 WebappLoader[/examples]: Deploying class repositories to work directory E:\Program Files\Apache Tomcat 4.0\work\localhost\examples
2002-03-20 13:58:48 WebappLoader[/examples]: Reloading checks are enabled for this Context
2002-03-20 13:58:48 StandardManager[/examples]: Seeding random number generator class java.security.SecureRandom
2002-03-20 13:58:48 StandardManager[/examples]: Seeding of random number generator has been completed
2002-03-20 13:58:50 ContextConfig[/examples]: Configured an authenticator for method FORM
2002-03-20 13:58:50 ContextListener: contextInitialized()
2002-03-20 13:58:50 SessionListener: contextInitialized()
2002-03-20 13:58:50 StandardContext[/examples]: Exception starting filter Compression Filter
java.lang.NoSuchMethodError
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:314)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3064)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3382)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
2002-03-20 13:58:50 StandardContext[/examples]: Exception starting filter Servlet Mapped Filter
java.lang.NoSuchMethodError
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:314)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3064)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3382)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
2002-03-20 13:58:50 StandardContext[/examples]: Exception starting filter Set Character Encoding
java.lang.NoSuchMethodError
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:314)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3064)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3382)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
2002-03-20 13:58:50 StandardContext[/examples]: Exception starting filter Request Dumper Filter
java.lang.NoSuchMethodError
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:314)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3064)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3382)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
2002-03-20 13:58:50 StandardContext[/examples]: Exception starting filter Path Mapped Filter
java.lang.NoSuchMethodError
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:314)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3064)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3382)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
2002-03-20 13:58:50 StandardContext[/examples]: Context startup failed due to previous errors
2002-03-20 13:58:50 SessionListener: contextDestroyed()
2002-03-20 13:58:50 ContextListener: contextDestroyed()


Seems like the Exception starting filter for Compression Filter is the first problem, though i just have no clue on what is causing it.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From your very first post:

Last time i ran a servlet was on jsdwk1.0.1

Make sure that there are no older versions of servlet.jar or anything else that might be hiding in your system CLASSPATH. Tomcat 4.x is not supposed to use system CLASSPATH, but you never know, and it certainly wouldn't hurt to remove it, since you will be using the new version.

Also make sure you haven't added any of these older jars by accident into Tomcat's lib or common/lib or even the examples/WEB-INF directory.

There was a bug report on this on Tomcat's buzilla, but it was closed without further investigation as "invalid". Here is that "bug":
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3850
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the bug report:
"That kind of class cast exceptions usually occur if you have the 2.2 version of the servlet API JAR in common/lib (or more generally, somewhere where the old classes could override the new classes - like in /WEB-INF/lib)."
 
chafule razgul
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all who replied, particularly to Mike and Thomas.
It turns out that i had indeed multple servlet.jars in my environment variable declarations. After removing them and upgrading my jdk to the latest version i was able to install tomcat without much problems.
Thank you again
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic