• Register
Welcome to Kodlogs, programming questions and answer website.
+1 vote
33 views

Spring Boot

I was trying to running my spring Boot application then i get this error using Tomcat embeddedinstead of using a container.

Using IntelliJ, run configuration is Spring Boot .

I have already a JAR file.

Running  application outputs only error, any suggestions;

by (390 points)  

2 Answers

0 votes

Try  spring-boot-maven-plugin and try to do packaging set to jar.

Try following code:

$ mvn package
$ java -jar target/mymodule-0.0.1-SNAPSHOT.jar
by (9.8k points)  
0 votes

You have to comment out some of dependencies for build.gradle file.

dependencies {
    //compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-security')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.apache.tomcat.embed:tomcat-embed-jasper:8.0.30')
    //compile('javax.servlet:servlet-api:2.5')
    //compile('javax.servlet:jstl:1.2')
    runtime('mysql:mysql-connector-java')
    providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
    testCompile('org.springframework.boot:spring-boot-starter-test')
}
by (9.8k points)  
...