• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Help Tomcat5.5.7: Error in catalina

 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
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
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.
 
Karthik Rajendiran
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 [email protected]
Thanks in advance.
R.Karthik
 
Karthik Rajendiran
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
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
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
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic