user3643168
user3643168

Reputation: 11

Struts 2 project is built using MyEclipse, but didn't not run on external Tomcat server

I build a Struts 2 + Hibernate web project using MyEclipse IDE.

When I run it in MyEclipse, Tomcat environment, it works fine, but I want to run it on Tomcat server separately (means apart from MyEclipse), so I export a .war file of project and deploy it on Tomcat manger - it is not working.

Second issue is that, when I copied my project from "My Eclipse\.metadata\.me_tcat\webapps\.." path and put it in Tomcat's webapps , but it is not working also - "HTTP Status 404 - /.." error occurred.

Is there any .jar file issue or something else?

Upvotes: 0

Views: 825

Answers (1)

Roman C
Roman C

Reputation: 1

If you are using MyEclipse you can deploy your application to the local server (not embedded). For this to work you should add a server on the Servers view and configure deploy configuration by right-clicking add deployment. There you can edit a context path that your application will run after deployment. You can use excellent Deploy button from the toolbar or the servers view. Note that MyEclipse copies files to the server, and you better not use "/" context path because in this case your webapps/ROOT folder will be overridden. If the application is deployed fine you can see in the logs the context path at which it has been started. Then you can access the application using this context path in the browser.

http://localhost:8080/yourappname/index.action 

This url supposed to invoke the index action name, that should be configured in struts.xml. This is an example of index action

<action name="index">
  <result>/index.jsp</result>
</action>

The second issue you should not copy/modify files in the metadata folder. This folder is used internally by MyEclipse unless you know what are you doing.

Upvotes: 0

Related Questions