You may have experience using eclipse develop spring mvc project and right click run as server but after everything is loaded you get nothing run on browser.
The following step is what you need to check.
- Java build path
- Web deployment assembly
Java Build Path
- Check is there any unbound server library, if yes removed it and add another.
- Check is the maven dependency exist in the Java Build Path Library tab, if not exist, right click project, maven update project ..
- Check is the Web App Libraries exist, if no add from Add Library… button
Web Deployment Assembly
Eclipse tomcat started without error but nothing deployed and loaded.
- Right click project property > Deployment Assembly
- Check the line /src/main/webapp, if missing perform the next.
- Click add.. button > Select Folder >
- Browse to src > main > webapp and click finish button.
- Click Apply and OK close the window
Started with the ClassNotFoundException:
- Right click project > Deployment Assembly
- Click Add button > Java Build Path Entries > Maven Dependencies
- Click Apply > OK > Close the window
project not able run as server
- Right click project property
- Select Project Facets
- Select Dynamic Web Module version from the drop down. (check your web.xml version)
- Select Java version from the drop down. (depends on what version you’re using)
- Checked the box, Dynamic Web Module
- Checked the box, Java and Javascripts
- On the right hand side runtimes button, checked the server you’re using.
- Click Apply, OK close the window.
- Delete the WebContent folder that generated by eclipse.
.
Started but nothing loaded
Now observe your console and find out the -Dwtp.deploy and copy the full path,
Open from the command prompt
open /Users/mingch/Documents/workspace-freelance/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps
Check the project is there any .class path get copy over. If no class file is copy, try the following solution.
1. From the project explorer, browse the target folder.
2. Check which folder contains full build. (include .class file and others web files)
3. Let’s say the m2e-wtp is empty, and [myproject] is the correct build folder. (build from maven package)
4. From the Deployment Assembly.
5. Click Add button > Folder > Target > [myproject].
6. Reploy tomcat.
7. You’re require build project whenver changes by using mvn package command.