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

Spring MVC project retunrs 404 in Eclipse IDE

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an issue in running a Spring MVC project on tomcat in eclipse IDE, when I launch the URL, I get 404. The same code is working perfectly fine when I create a war file and deploy from tomcat console.
Does anyone had this issue ? Any inputs would be greatly appreciated, I have been spending lot of time to test small change.
 
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say "launch the url", are you doing a right click on your project, then Ran As, then Run on Server?  Sounds more like you are doing all that directly on the .jsp file.
 
Naveen N Kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Tim
I was working on a maven project and when I clean and recompile the project and deploy on Tomcat  which is added Eclipse I get 404 error,

although same is working when I create a war and deploy from tomcat console.

If I don't clean the project, it works fine, wondering whats happening behind ??
 
Tim Nachreiner
Ranch Hand
Posts: 93
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First: Do you have the tomcat plugin in your pom.xml file?

Second: You need to remember that doing a Maven clean install does not start the tomcat server, that's why you are getting the 404 error.

You should launch your application by right-clicking, choosing Run-as, Maven build..., then enter tomcat7:run in the Goals text box (this assumes you have the tomcat7 plugin configured in your pom.xml file.

I'm assuming you are following an online tutorial.  Which one is it?
 
Naveen N Kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Tim

I don't have tomcat plugin in POM.xml. I would give a try with plugin.  I am following JavaBrains tutorials on YouTube and Spring/Hibernate reference documents.

Thanks for your reply
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Naveen

First. Please check location of web pages, are they placed in webcontent folder or not.

Second, also check the path of index page. Is is correct or not


I think there is no need of tomcat plugin in pom.xml


we can add apache tomcat from add server option in IDE.


You may need to add servlet dependency ....


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic