1

I'm trying to deploy my Spring Boot app using Heroku Maven Plugin. The deploy finishes fine (mvn heroku:deploy). But when I check Heroku app logs (heroku logs --tail), I see it isn't finding the Main class:

2017-10-03T23:50:45.702415+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -cp target/classes:target/dependency/* Main`
2017-10-03T23:50:48.064526+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2017-10-03T23:50:48.068505+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -Dfile.encoding=UTF-8
2017-10-03T23:50:48.237240+00:00 app[web.1]: Error: Could not find or load main class Main
2017-10-03T23:50:48.314862+00:00 heroku[web.1]: State changed from starting to crashed
2017-10-03T23:50:48.301181+00:00 heroku[web.1]: Process exited with status 1

I don't have any Procfile (rely on defaults). Heroku Maven Plugin configuration looks like this:

<plugin>
    <groupId>com.heroku.sdk</groupId>
    <artifactId>heroku-maven-plugin</artifactId>
    <version>1.2.0</version>
    <configuration>
        <processTypes>
            <web>java $JAVA_OPTS -cp target/classes:target/dependency/* Main</web>
        </processTypes>
    </configuration>
</plugin>

The Main class path is:

BASEPROJDIR/src/main/kotlin/com/virtualstand/ExplorerApplication.kt
2
  • 2017-10-04T08:32:57.264704+00:00 app[web.1]: Error: Could not find or load main class ExplorerApplication Commented Oct 4, 2017 at 8:33
  • 1
    it works!! thanks!! Commented Oct 4, 2017 at 10:23

1 Answer 1

1

You need to make sure that the classpath to the main class is correct:-

<configuration>
    <processTypes>
        <web>java $JAVA_OPTS -cp target/classes:target/dependency/* com.virtualstand.ExplorerApplication</web>
    </processTypes>
</configuration>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.