Do you know you can earn heaps of $$ by answering questions on kodlogs, for more info contact us through feedback link at footer? We are Australian based web site and pay you for answering questions

  • Register
Welcome to Kodlogs Q&A, where you can ask programming questions and receive answers from other members of the community. For programmers, by programmers Kodlogs is an open community for anyone that does coding. We help you get answers to your toughest coding questions, share knowledge with your coworkers in private, and find your next IT dream job.
+1 vote
3 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 (8.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 (8.8k points)  
...