• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat looking into Doc root . why ?

 
Nandan Jain
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic