Two Laptop Bag
The moose likes Tomcat and the fly likes Help Tomcat5.5.7: Error in catalina Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Help Tomcat5.5.7: Error in catalina" Watch "Help Tomcat5.5.7: Error in catalina" New topic
Author

Help Tomcat5.5.7: Error in catalina

Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 209
Hello Ben Souther,
I am very thankful to you for helping me in previous queries.
i have configured tomcat

my webapp is in
d:\tomcat5.5\webapps\karthik
karthik - webapp
inside karthik i have web-inf, web-inf\classes
web-inf\web.xml

inside web-inf\classes\HelloWorld.class

but when i run the server and type
http:\\localhost:8080\servlet\HelloWorld
Pagenot found error comes
where as the default page http:\\localhost:8080 comes correctly.
Please help me wht are the otherthings to set

The error displayed is

Feb 13, 2005 9:26:21 AM org.apache.catalina.core.ApplicationContext log
SEVERE: invoker: Cannot allocate servlet instance for path /servlet/HelloWorld
javax.servlet.ServletException: Wrapper cannot find servlet class HelloWorld ora class it depends on



MY WEB.XML IN WEBAPPS HAS THE FOLLOWING ENTRY
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>

</web-app>



My D:\Tomcat 5.5\conf\Catalina\localhost\karthik.xml
contents
<?xml version="1.0" encoding="UTF-8"?>
<Context
docBase="karthik"
privileged="true"
reloadable="true"
path="/karthik">
<ResourceLink
global="UserDatabase"
name="users"
type="org.apache.catalina.UserDatabase"/>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>META-INF/context.xml</WatchedResource>
</Context>


PLEASE HELP ME
THANKS IN ADVANCE..


SCJP 1.4 SCWCD 1.4 SCDJWS 1.4
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Two Things:

1.) You should always put your java classes in packages.
Before jdk1.4, you could get away with using package-less beans but it's tightened up a bit. Rather than try to figure out when you can and can't get away without packages, just package everything.

2.) You need a servlet-mapping for your hello servlet.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 209
Originally posted by Ben Souther:
Two Things:

1.) You should always put your java classes in packages.
Before jdk1.4, you could get away with using package-less beans but it's tightened up a bit. Rather than try to figure out when you can and can't get away without packages, just package everything.

2.) You need a servlet-mapping for your hello servlet.




Even if i used that servlet-mapping i am unable to get my serlvet display.
I can understand the package concepts. This simple servlet itself is not working.

If u have xml configured already for a simple servlet can u mail me that. can you Mail me all the xml needed for setting up context path with description too stating the modification done or needed please.
My id karthik_rcs@hotmail.com
Thanks in advance.
R.Karthik
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 209
Now it's working.
Thank you very much Mr.Ben for your kind reply and response.

Karthik
(Living at the edge of J2EE Platform)
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Glad it's working.
What was it?


Tip: The power of a forum like this the large number of eyes reading your post. With hundreds of people reading your question, one is bound to know exactly what the problem is. If you start out a thread by addressing a specific person by name, you're cutting down on the number of people who will read it, and potentially help you with it. This is especially true if you send the post as a private message PM. I personally never answer technical questions via PM as it is the surest route to answering the same questions over and over again.
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 209
The Error was due to trivial thing
I was referring my custom web app
htt:\\localhost:8080\servlet\HelloWorld
which should be htt:\\localhost:8080\karthik\servlet\HelloWorld

At last i found it.
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help Tomcat5.5.7: Error in catalina
 
Similar Threads
Tomcat 4 : How to deploy and run JSP and Servlets
Simple HelloServlet not working
Tomcat 5.0.27 Http status 404 Error
Servlet Not working
Deploying Servlet in Tomcat 5.0