Reputation: 1149
I am trying out Spring Boot to create a simple MongoDB REST service, but for the life of me cannot figure out why it is so resistant to start. I had these dependencies compiling at runtime with Gradle
compile('org.mongodb:bson:3.3.0')
compile 'org.mongodb:mongodb-driver:3.3.0'
compile('org.springframework.boot:spring-boot-starter-data-mongodb')
compile('springframework:spring-web:1.2.6')
And the app was exiting early with some cryptic message:
Closing org.springframework.context.annotation.AnnotationConfigApplicationContext
So then I tried to add some more dependencies to see if that would help...god, I had dependencies:
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-tomcat")
And that resulted in an even more cryptic message:
java.lang.NoSuchMethodError: org.springframework.web.context.support.ServletContextAwareProcessor: method <init>()V not found
I feel like this process is unceccessarily complex to start such a simple service...I have done this with Express, Revel, and Django very simply, but Spring Boot just doesn't seem to make it easy. What am I missing about this process?
Thanks!
Upvotes: 0
Views: 332
Reputation: 44555
Remove
compile('springframework:spring-web:1.2.6')
from your Gradle file. This artifact is ages old. The Spring Boot dependencies bring in all necessary Spring dependencies, so it is usually not necessary, to specify Spring dependencies itself.
Upvotes: 1