Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

Tomcat 5 runs what Tomcat 4 doesn't after modifying WEB.XML

Thread view: 
vunet.us@gmail.com - 17 Apr 2007 16:34 GMT
Hi,
WEB.XML file was modified by adding something like:

<servlet>
 <servlet-name></servlet-name>
 <servlet-class></servlet-class>
 <load-on-startup></load-on-startup>
</servlet>
<servlet-mapping>
 <servlet-name></servlet-name>
 <url-pattern></url-pattern>
</servlet-mapping>

Since this modification, my application stopped running on Tomcat 4
but runs well on Tomcat 5. Where can the problem be? I am not an
expert in Tomcat management, but can you point me out to a possible
reason? Is it possibly the declaration as:

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
Wojtek - 17 Apr 2007 17:30 GMT
vunet.us@gmail.com wrote :
> Hi,
> WEB.XML file was modified by adding something like:
[quoted text clipped - 17 lines]
>  "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

Well an empty url mapping probably matches everything. Since every
other setting is also empty, there is nothing for TomCat 4 to map to.

TomCat 5 probably ignores the empty mapping, with possibly an error
message in the logs.

Why would you want an empty mapping?

Signature

Wojtek :-)

vunet.us@gmail.com - 17 Apr 2007 17:36 GMT
> vunet...@gmail.com wrote :
>
[quoted text clipped - 30 lines]
> --
> Wojtek :-)

it's not empty, I just did not specify servlet name. do you need to
see stuff in there?
Wojtek - 17 Apr 2007 17:46 GMT
vunet.us@gmail.com wrote :
>> vunet...@gmail.com wrote :
>>
[quoted text clipped - 28 lines]
> it's not empty, I just did not specify servlet name. do you need to
> see stuff in there?

You did not specify ANYTHING. It is all empty. Every setting.

The mapping goes as follows:
- a url. This is what the browser sends to the server
- Tomcat finds the url in its list
- Tomcat matches the <servlet-name> parameters between the
<servlet-mapping> and <servlet>
- Tomcat either instantiates the <servlet-class> or finds it in its
cache.

So if there is nothing there, then Tomcat cannot possibly run anything.

Signature

Wojtek :-)

vunet.us@gmail.com - 17 Apr 2007 19:19 GMT
> vunet...@gmail.com wrote :
>
[quoted text clipped - 45 lines]
> --
> Wojtek :-)
if you wish:
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
........
<servlet>
 <servlet-name>myServlet</servlet-name>
 <servlet-class>direct.myServlet</servlet-class>
 <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
 <servlet-name>myServlet</servlet-name>
 <url-pattern>/servlet/direct.myServlet</url-pattern>
</servlet-mapping>
........
</web-app>
Lew - 18 Apr 2007 01:41 GMT
> if you wish:
> (finally provides necessary information)

Don't act like you're doing him a huge favor.  You asked for help, but the
information you originally gave was not accurate.  How can you expect accurate
information when you don't provide accurate information?  It's yourself for
whom you do the favor; it's if /you/ wish for good answers.

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.