问题描述: LoggerFactory 不是Logback 的LoggerContext,但是Logback却会在classpath上。需要禁用掉Logback,猜测是pom中的引用出现了问题
原来的pom文件如下:
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
spring-boot-starter-parent
org.springframework.boot
1.0.1.RELEASE
com.fe
cloudapp
1.0.0
Withinet-PaaS
Develop your web applications in on our infrastructure and we will worry about administration and scalability of your app.
1.7
16.0.1
UTF-8
UTF-8
com.sun.jersey
jersey-client
1.8
com.withinet.cloudapp
slave
1.0.0
org.apache.wicket
wicket-core
6.15.0
org.hibernate
hibernate-core
4.3.0.Final
com.google.code.gson
gson
2.2.4
org.springframework.boot
spring-boot-starter
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-starter-web
javax.validation
validation-api
1.1.0.Final
org.hibernate
hibernate-validator-annotation-processor
4.1.0.Final
com.google.guava
guava
${guava.version}
javax.inject
javax.inject
1
org.apache.lucene
lucene-queryparser
4.8.0
org.springframework.boot
spring-boot-starter-tomcat
provided
org.springframework.boot
spring-boot-maven-plugin
com.withinet.cloud.Application
JAR
repackage
解决方法如下:
需要手动地解除spring-boot-starter和spring-boot-starter-web中的那些logging。需要将pom文件中的上述两项进行如下改造:
org.springframework.boot
spring-boot-starter
org.springframework.boot
spring-boot-starter-logging
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-logging
这样就解决了冲突问题啦!