0
votes

Im trying to deploy a war file in Tomcat and im having issues accessing the application. The code actually works fine in eclipse and Im able to access the application.The application that im accessing is a struts based application

Changes Done in eclipse

I have made the below change in eclipse. Changed the context path from 
<Context docBase="iowe" path="/iowe" reloadable="true" source="org.eclipse.jst.jee.server:iowe"/></Host>   to
 <Context docBase="iowe" path="/" reloadable="true" source="org.eclipse.jst.jee.server:iowe"/></Host>

With the above change, When I start tomcat in eclipse it works fine and im able to access the application. When I create a war file and try to deploy it in tomcat, im facing issues accessing the application. Getting the below error message

HTTP Status 404 - There is no Action mapped for namespace / and action name login.message There is no Action mapped for namespace / and action name login.

While deploying the war file in tomcat, I have also updated the server.xml with the below context path as in eclipse

<Context docBase="iowe" path="/" reloadable="true"/>

The deployment happens, but unable to access the login page via the url http://localhost:8080/iowe/login.do. Getting the above error message. It specifies no action mapped. But there is mapping available for login in struts.xml

Analysis Done

Below are the analysis that I have done

  1. I have also changed the context path in server.xml to Context docBase="D:\iowe\apache-tomcat-7.0.59\webapps\iprowe" path=""/>. restarted tomcat and tried accessing the application. Still getting the same error.
  2. Followed the steps in the link and Created a ROOT.xml file and included the context path to Context docBase="C:\Tomcat8.0\webapps\iowe" path="/" reloadable="true". Restarted the tomcat server and checked but it did not work. Getting the same error again

Any help on this is much appreciated. Thanks in Advance

1
This change you made in Eclipse to add the Context, was that the same file used when you launch Tomcat from outside of Eclipse?nitind
Hi - yes it was the same server.xml file that I used outside of ecllipse as well.vr3w3c9

1 Answers

0
votes

Please try the following steps: Option 1

-Undo your server.xml

  • Copy your war in :

$CATALINA_HOME\webapps

If the instance is running, the deployment will start instantly as Tomcat unpacks the archive and configures its context path.

If the instance is not running, then the server will deploy the project the next time it is started.

Note:

$CATALINA_HOME

This variable points to the directory where our server is installed.

Option 2 Using Tomcat Manager:

You need to configure Tomcat Roles

$CATALINA_HOME/conf/tomcat-users.xml

<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="password" roles="manager-gui, manager-script"/>

Then access to admin manager using

http://{host}:{port}/manager/html

Deploy your war using Admin manager.

Please have a look of Admin manager at https://tomcat.apache.org/tomcat-7.0-doc/html-manager-howto.html