Issue
The Github repo is https://github.com/jzheaux/terracotta-bank-spring and I want an executable jar file for this project so my steps are
jar gets created successfully inside build/libs
cd build/libs
java -jar terracotta-bank-spring-0.0.1-SNAPSHOT.jar
Spring starts successfully
- But when I click on
localhost:8080
I get the below error when Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Oct 12 18:43:47 SGT 2020 There was an unexpected error (type=Not Found, status=404). /index.jsp
Solution
This is a spring-mvc
project with .jsp
files. Jsp files are handled differently when run as a jar or inside a app server.
When you try to build the project with ./gradlew clean build
a war
file will be generated. You can run the war as a standalone server because it has embedded tomcat as a dependency. Just run
cd /build/libs
java -jar terracotta-bank-spring-0.0.1-SNAPSHOT.war
Then go to http://localhost:8080
Answered By - Shawrup
Answer Checked By - Candace Johnson (JavaFixing Volunteer)