aspose file tools*
The moose likes Tomcat and the fly likes Tomcat container not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat container not working" Watch "Tomcat container not working" New topic
Author

Tomcat container not working

Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

As ,it's specified in the Book (Head First Servlet and JSP) that ,whenever a tomcat or any other container starts it will go to the webapp and come to know the <servlet-class>.

In my example i have ,i have not given the correct web.xml[means syntax is wrong] ,i taught i may get some error on deployment but i'm not getting than later i tried to restart my tomcat , than i may get so [like DeploymentException or something] ,i didn't get.

See my syntax is wrong, <servlet-class>
Page Number in the book is 102,Chapter 4 .

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

Usually a URL ending in ".do" is a Struts URL. Struts requires mapping those URLs to the Struts Action Servlet, not a user-written servlet. In any event the "servlet-class" element in web.xml should envelope a fully-qualified servlet classname.


Customer surveys are for companies who didn't pay proper attention to begin with.
Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

Why it's(Tomcat Container) not giving DeploymentException.??!
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12805
    
    5


is NOT valid XML - look at the servlet-class element. Tomcat will not recognize a web app if the web.xml is incorrect, causing a parse error early in the loading processs.

Fix your web.xml and restart - NOTE: servlet-class MUST be in a package and the class file in a directory corresponding to the package.

Bill
Note that there will be an error report somewhere in the Tomcat logs.
Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

William Brogden wrote:

is NOT valid XML - look at the servlet-class element. Tomcat will not recognize a web app if the web.xml is incorrect, causing a parse error early in the loading processs.



I know it's not valid XML. i'm not getting parse error early in the loading processs.

( I don't know why ,i'm not getting parse error early in the deployment process.)
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12805
    
    5
IF Tomcat does not try to parse web.xml
THEN Tomcat does not think there is a web application in the directory so it does not even bother to try to parse web.xml
THEREFORE There is something wrong with your directory layout or configuration files.

Bill
Arun Giridharan
Ranch Hand

Joined: Sep 30, 2010
Posts: 290

William Brogden wrote:IF Tomcat does not try to parse web.xml
THEN Tomcat does not think there is a web application in the directory so it does not even bother to try to parse web.xml
THEREFORE There is something wrong with your directory layout or configuration files.

Bill


How to find out what's going wrong ?? (can i post my simple servlet program.)
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12805
    
    5
How to find out what's going wrong ?? (can i post my simple servlet program.)


As I tried to point out, your program has NOTHING to do with your problem - Tomcat is not even trying to load your program so any program errors remain undiscoverable.

It is your configuration - ie the directory organization/layout and configuration files - which Tomcat is not recognizing as a web application.

Presumably your tomcat installation has some working applications such as "examples." Study how working examples are laid out.

One common beginner error has to do with directory names - Java cares about case in directory and file names even if windows doesn't.

So web-inf will not be recognized - WEB-INF is required, etc etc.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat container not working