aspose file tools*
The moose likes Tomcat and the fly likes tomcat looking into Doc root  . why ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat looking into Doc root  . why ?" Watch "tomcat looking into Doc root  . why ?" New topic
Author

tomcat looking into Doc root . why ?

Nandan Jain
Ranch Hand

Joined: Feb 14, 2006
Posts: 44
Hi,
I have created small application under webapps on Tomcat. everything is fine like html files, web.xml, java/class files and application works prefect on my local machine. Now the problem appears when I create same application on Server (Sun solaris, Java version is "1.4.2_04" ).
I modified the Server.xml file and restarted server. when I ran the application index.html page appears and after hitting the 'Submit' button,
on the next page its says 'Page cannot be found'. I looked into log files and I found out everytime tomcat server look for the page into Doc root istead of under WEB-INF/classes/. Web server is suppose to look into web.xml and depending upon the entries there It should look into WEB-INF/classes but no its looking for file some where else (in Doc root).
can anyone let me know why ??

Regards,
Nandan
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
I modified the Server.xml file and restarted server. when I ran the application index.html page appears and after hitting the 'Submit' button,
on the next page its says 'Page cannot be found'

For some reason it is not recognizing the link in your form as pointing to a servlet. This sounds like an error in your web.xml definition.
Another possibility is that your local Tomcat has the "invoker" servlet turned on but the solaris server does not.
What exactly did you do to the server.xml file and why did you do it?
Bill
Nandan Jain
Ranch Hand

Joined: Feb 14, 2006
Posts: 44
The reason I am editing server.xml is, I want to deploy application on web server and I dont have GUI...so I manually edit server.xml.
Next here is web.xml file
-----------------------------------------------
<web-app>

<servlet>
<servlet-name>
ref1
</servlet-name>
<servlet-class>
Result
</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>
ref1
</servlet-name>
<url-pattern>
/home
</url-pattern>
</servlet-mapping>

</web-app>

-----------------------------------------------
Nandan Jain
Ranch Hand

Joined: Feb 14, 2006
Posts: 44
here is html file index.html action tag :
<form action="/Test/home" method="post">

------------------------------------
here is server.xml file

<WEBAPP uri="/Test" path="/opt/SUNWwbsvr/https-etcad14-ForgotPassword/webapps/Test" enabled="true"/>
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Nandan Jain:

here is server.xml file

<WEBAPP uri="/Test" path="/opt/SUNWwbsvr/https-etcad14-ForgotPassword/webapps/Test" enabled="true"/>


What container are you using on the Solaris box?
This is not a tomcat server.xml file.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
<servlet-class>
Result
</servlet-class>

If that worked, I bet your local server is using the dreaded "invoker" -cause of much grief among servlet programmers.
See this entry in the FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat looking into Doc root . why ?