Home > OS >  Exception in thread main NoClassDefFoundError: org/springframework/boot/SpringApplication
Exception in thread main NoClassDefFoundError: org/springframework/boot/SpringApplication

Time:11-28

during deploing my Spring Boot App on heroku i got this error


Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication

My Pom.xml build part:


    <build>
        <plugins>
            <plugin>
                <groupId>com.heroku.sdk</groupId>
                <artifactId>heroku-maven-plugin</artifactId>
                <version>1.1.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>

                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.github.jsimone</groupId>
                                    <artifactId>webapp-runner</artifactId>
                                    <version>8.5.11.3</version>
                                    <destFileName>webapp-runner.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

I only found some solutions for running application localy but i have this problem only on Heroku side. In other solutions it is solved by updating dependencies. Problem is i have no idea how can i deploy my dependencies to HerokuApp.

CodePudding user response:

This error is Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found. The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found. According to official source: Project tree

  • Related