• 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

404 errors in servlets

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Im new to Tomcat server4.1
i developed simple servlet and deployed in following directory

c:\javaprogram\web-inf\classes

and i did following changes

1.set the classpath in environment variables
c:\javaprogram\web-inf\classes;

2.set my context path to c:\javaprogram in server.xml

and

3.having web.xml is available in c:\javaprogram\web-inf\classes

eventhough its telling the 404 error

im not able to find the solution ..

please dont hesitate to answer...

and also dont point out "THIS IS NOT RIGHT PLACE TO ASK"

OK..

cheers
vasu
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/deployment.html

read this.
 
vasu devan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi krishna

i went throught that site..
eventhough im not very clear about that..
i mentioned my query clearly..
give me step by step solution..
most of the things i followd..but
eventhough its coming 404 error..

anywhere to configure ..

please guide me to get solution

regards
vasu
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im new to Tomcat server4.1
Then is there any reason you are starting out with an old release?
There have been significant changes in the 5x branches.

i developed simple servlet and deployed in following directory
c:\javaprogram\web-inf\classes
It should be javaprogram\WEB-INF\classes (case sensitive)

1.set the classpath in environment variables
c:\javaprogram\web-inf\classes;
Tomcat doesn't use your classpath. It finds classes by looking through
a specific set of directories (which is why you need to get the case right).

2.set my context path to c:\javaprogram in server.xml
For 4.1, that is the correct way to do it. This has changed in 5x so you
will need to change your approach when you upgrade. Again, I would start out with a more recent version.

3.having web.xml is available in c:\javaprogram\web-inf\classes
Your web.xml file should be in c:\javaprogram\WEB-INF\ (not under classes).

eventhough its telling the 404 error
im not able to find the solution ..

I would start by looking at the log files under TOMCAT_HOME/logs.

please dont hesitate to answer...
No hesitation here.

and also dont point out "THIS IS NOT RIGHT PLACE TO ASK"
There is a forum devoted to Apache/Tomcat on this site. If it's appropriate to do so, people will point it out.

cheers
vasu
Cheers

Also, you may want to skip writing an entry in server.xml and just let Tomcat auto-deploy the app for you. You do this by building your web app's directory structure under TOMCAT_HOME/webapps.
If you want a working example, download SimpleServlet.war from http://simple.souther.us to your webapps directory. Tomcat will unpack and deploy it for you. You will have a properly structured web app with all the right entries in the web.xml file to use as a reference.

Good-Luck
[ April 18, 2005: Message edited by: Ben Souther ]
 
vasu devan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Ben
Thnaks for your Reply

i did what are all the steps that you have written

but eventhough im not able to start web server

its setting logs in /logs folder

the contents are pasted here.please help me

2005-04-18 14:29:48 WebappLoader[/javaprogram]: Deploying class repositories to work directory C:\Tomcat-4.1\work\Standalone\localhost\javaprogram
2005-04-18 14:29:48 WebappLoader[/javaprogram]: Deploy class files /WEB-INF/classes to C:\javaprogram\WEB-INF\classes
2005-04-18 14:29:48 ContextConfig[/javaprogram]: WARNING: Security role name tomcat used in an <auth-constraint> without being defined in a <security-role>
2005-04-18 14:29:48 ContextConfig[/javaprogram]: WARNING: Security role name role1 used in an <auth-constraint> without being defined in a <security-role>
2005-04-18 14:29:48 ContextConfig[/javaprogram] Exception processing TLD at resource path /WEB-INF/jsp/debug-taglib.tld
javax.servlet.ServletException: Exception processing TLD at resource path /WEB-INF/jsp/debug-taglib.tld
at org.apache.catalina.startup.ContextConfig.tldScanTld(ContextConfig.java:963)
at org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:811)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:587)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:181)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3523)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)
----- Root Cause -----
java.lang.IllegalArgumentException: Invalid TLD resource path /WEB-INF/jsp/debug-taglib.tld
at org.apache.catalina.startup.ContextConfig.tldScanTld(ContextConfig.java:955)
at org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:811)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:587)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:181)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3523)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)

2005-04-18 14:29:48 ContextConfig[/javaprogram]: Marking this application unavailable due to previous error(s)
2005-04-18 14:29:48 StandardManager[/javaprogram]: Seeding random number generator class java.security.SecureRandom
2005-04-18 14:29:48 StandardManager[/javaprogram]: Seeding of random number generator has been completed
2005-04-18 14:29:48 StandardContext[/javaprogram]: Context startup failed due to previous errors


provide me the solution..

cheers
vasu
 
vasu devan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben

Tnx for your Information

i come hear without probelom...
and also the sapecific classnofoundexception caught because the particular class file not found in web-inf/classes.

and its working fine now..

but only one query...may be im doubting...

when i call the servlet

http://localhost:8080/javaprogram/HelloWorld its working fine

but usually we wil call only through

http://localhost:8080/javaprogram/servlet/HelloWorld

but if we call through above statement...
its telling 404..

just clarify my doubt...

Note:
Initially im using Resin web server

cheers
vasu
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using
http://localhost:8080/javaprogram/servlet/HelloWorld
is an outdated way of calling servlets via the invoker servlet.

The invoker servlet has been disabled in all current versions of Tomcat (and it's equivalent in all the other servers as well) because it was a disaster.

See: http://faq.javaranch.com/view?InvokerServlet for the details.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic