0

I've got a project in Eclipse, with a .war file inside it. I'm using Spring for the project, with the help of Maven too.

I've installed Tomcat 8, but I'm having trouble deploying the webapp to Tomcat. The Tomcat runs without errors and the console output of launching the Tomcat looks like it is successfully deploying it, however when I go to localhost is just displays the generic Tomcat home page saying I have successfully deployed Tomcat.

I've tried changing my server location to use the tomcat installation, I've changed the location in the properties of my server to not be the workspace metadata.

When I add jars to the tomcat, I click on my project, and under it it lists the Spring jar if that is of any relevance.

I don't really know what else to put here at the moment, but I'm at hand to respond immediately to any questions or any more info that you require.

Thanks.

EDIT: http://localhost:8080, it leads me to this: https://i.stack.imgur.com/sy54R.png My tomcat console output is: https://gist.githubusercontent.com/J-Owens/8164b3ec6dbed9986322/raw/6756486aad0092647bbea8f315c42ac5ba9550b1/tomcatconsole

James
  • 749
  • 1
  • 9
  • 22
  • What is the URL that you are using to view your page? – Some guy Jul 21 '15 at 19:33
  • http://localhost:8080, it leads me to this: http://i.imgur.com/82lmpai.png My tomcat console output is: https://gist.githubusercontent.com/J-Owens/8164b3ec6dbed9986322/raw/6756486aad0092647bbea8f315c42ac5ba9550b1/tomcatconsole – James Jul 21 '15 at 19:36
  • You're probably hitting the `http://localhost:8080` which corresponds to the context root of the `root` web application (this usually comes bundled with the Tomcat). Try accessing your app, by `http://localhost:8080/contextRootOfYourApp`. You can control the context root of your webapp on eclipse: http://stackoverflow.com/a/8334309/934307. – mystarrocks Jul 21 '15 at 19:42
  • You can even check the context root of your app using the `Manager app` button on the home page you've shown in your image. You should setup appropriate permissions beforehand, of course, though. Read about it here: https://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html and here: https://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#List_Currently_Deployed_Applications – mystarrocks Jul 21 '15 at 19:43

1 Answers1

1

Each war file will have a name associated with it. When you use localhost:8080 as the URL, Tomcat will use the war with name ROOT under tomcat/webapps to display on the browser. By default, Tomcat will have a ROOT war that comes with the tomcat bundle. If you need to open your project, you will need to use localhost:8080/<your-war-name> to open your project's page. Alternatively, you could remove everything under tomcat/webapps and rename your war to ROOT to be able to access your project pages with the localhost:8080.

Some guy
  • 1,210
  • 1
  • 17
  • 39
  • From the gist that you have posted, looks like your project is packaged as `Alpha-1.war`. Try the URL `localhost:8080/Alpha-1` and see if that works – Some guy Jul 21 '15 at 19:43
  • You got it working! Is there any way to get it running under localhost:8080 without renaming it ROOT? What if I have sub web pages, will that be affected by renaming the folder in tomcat/bin to ROOT? – James Jul 21 '15 at 19:45
  • Renaming it to ROOT will be for the entire project. So even the subpages can be accessed this way. I'm not sure of any other method other than renaming to ROOT. – Some guy Jul 21 '15 at 19:52