I am attempting to deploy a Spring Boot app on Heroku following this guide: http://codingricky.com/booting-spring-boot-into-heroku/ (thanks Ricky Yim)
It seems pretty straight forward, but my app includes an integration.xml
as required by the spring-messaging
dependency:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
</dependency>
That being said, I'm not using Spring Integration
just websockets / STOMP messaging. So the dependency is required.
I get a simple not found error when the app tries to boot:
Caused by: java.io.FileNotFoundException: class path resource [integration.xml] cannot be opened because it does not exist
Locally integration.xml
is in the /src/main/resource
directory and is located fine when I run as -> spring boot
from Eclipse.
I also have a single page of html and some javascript files to debug websockets / STOMP messaging like the guide here: https://spring.io/guides/gs/messaging-stomp-websocket/
What do I need to change so the app can find these files in the /resource
directory when deployed as a jar?
If you build your JAR using Maven and the default settings you should find that everything from "src/main/resources" is in the root of the JAR, and therefore on the classpath if you run with "java -jar". I don't know how the Heroku buildpack runs a JAR (does it use "java -jar" or does it unpack it and do something different?) so the answer might be there.
If you can run your JAR file locally I'd expect it to work on a PaaS, but who knows what they might be doing to it at runtime.
BTW, "spring-messaging" does not require any XML configuration, so you should probably look into that and try and understand where the error message is actually coming from. If you share your project in github it will be a lot easier to suggest what you might have done wrong.