You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 30, 2019. It is now read-only.
Been doing a bit of fiddling about with generating a Jar and then deploying it to a separate server and found a bit of an issue.
Steps to reproduce:
Open command prompt
cd marklogic-samplestack\appserver\java-spring
gradlew assemble
cd build\libs
java -jar samplestack-1.1.0.jar
(NB, don't run it from the java-spring folder)
Expected result:
Application starts up using embedded tomcat and serves all content
Actual Result:
Application starts up and doesn't throw any errors, but can't access the home page (index.html. There is no static content in the jar file (extracting the jar confirms this)
Potential Fix:
It seems the reason for this is by default gradle doesn't include the "static" folder in its current location
Steps
Move "static" folder into src/main/resources
Rebuild -> now present in Jar
Update marklogic-samplestack\shared\js\dev-tasks\context.js to:
var javaStaticDir = path.resolve(
projectRoot, 'appserver/java-spring/src/main/resources'
);
Keen to hear if people think this is a sensible approach or if there's an obviously better way to go about it.
Hi Folks,
Been doing a bit of fiddling about with generating a Jar and then deploying it to a separate server and found a bit of an issue.
Steps to reproduce:
(NB, don't run it from the java-spring folder)
Expected result:
Actual Result:
Potential Fix:
It seems the reason for this is by default gradle doesn't include the "static" folder in its current location
Steps
var javaStaticDir = path.resolve(
projectRoot, 'appserver/java-spring/src/main/resources'
);
Keen to hear if people think this is a sensible approach or if there's an obviously better way to go about it.
Here's a related stackoverflow answer:
http://stackoverflow.com/questions/29172612/spring-boot-app-not-serving-static-content
The spring boot docs mention this:
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-spring-mvc-static-content
Thanks,
James
The text was updated successfully, but these errors were encountered: