Re: Starting Spring Boot App after deploying it to CF


Naga Rakesh
 

Did you make your jar/war executable? if not that would help.

Just add the following below the dependency in pom

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins></build>

spring-boot-maven-plugin will help make the jar/war executable


Thanks,
Venkata

On Thu, Sep 10, 2015 at 12:33 PM, Qing Gong <qinggong(a)gmail.com> wrote:

I built a Spring Boot App and using java -jar SpringBootApp.jar to run it,
the code works as expected. The System.out printed as expected.

public static void main(String[] args)
{
SpringApplication.run(Application.class, args);
System.out.println("Spring Boot Test Message");
}

However, when deployed in CF using cf push myApp -p SpringBootApp.jar, the
main() was not executed. I have tried using META-INF/MANIFEST.MF to include
the Main-Class, or using config/java-main.yml, or manifest.yml to include
java_main_class, none worked. The app just would not start. Do I need to do
anything else to trigger the app to start its main method?

Thanks!

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.