• 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 container not working

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


 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why it's(Tomcat Container) not giving DeploymentException.??!
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic