• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

tomcat looking into Doc root . why ?

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
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

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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"/>
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic