spring boot - Disable Logback in SpringBoot -
it appears springboot autoconfigures use logback tomcat. disable , use 1 provide in classpath.
the error message below.
loggerfactory not logback loggercontext logback on classpath. either remove logback or competing implementation (class org.slf4j.impl.simpleloggerfactory) object of class [org.slf4j.impl.simpleloggerfactory] must instance of class ch.qos.logback.classic.loggercontext
<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <parent> <artifactid>spring-boot-starter-parent</artifactid> <groupid>org.springframework.boot</groupid> <version>1.0.1.release</version> </parent> <groupid>com.fe</groupid> <artifactid>cloudapp</artifactid> <version>1.0.0</version> <name>withinet-paas</name> <description>develop web applications in on our infrastructure , worry administration , scalability of app.</description> <properties> <java.version>1.7</java.version> <guava.version>16.0.1</guava.version> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <project.reporting.outputencoding>utf-8</project.reporting.outputencoding> </properties> <dependencies> <dependency> <groupid>com.sun.jersey</groupid> <artifactid>jersey-client</artifactid> <version>1.8</version> </dependency> <dependency> <groupid>com.withinet.cloudapp</groupid> <artifactid>slave</artifactid> <version>1.0.0</version> </dependency> <dependency> <groupid>org.apache.wicket</groupid> <artifactid>wicket-core</artifactid> <version>6.15.0</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-core</artifactid> <version>4.3.0.final</version> </dependency> <dependency> <groupid>com.google.code.gson</groupid> <artifactid>gson</artifactid> <version>2.2.4</version> </dependency> <!-- spring boot --> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-test</artifactid> <scope>test</scope> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> </dependency> <!-- hibernate validator --> <dependency> <groupid>javax.validation</groupid> <artifactid>validation-api</artifactid> <version>1.1.0.final</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-validator-annotation-processor</artifactid> <version>4.1.0.final</version> </dependency> <!-- guava --> <dependency> <groupid>com.google.guava</groupid> <artifactid>guava</artifactid> <version>${guava.version}</version> </dependency> <!-- java ee --> <dependency> <groupid>javax.inject</groupid> <artifactid>javax.inject</artifactid> <version>1</version> </dependency> <!-- search --> <dependency> <groupid>org.apache.lucene</groupid> <artifactid>lucene-queryparser</artifactid> <version>4.8.0</version> </dependency> <!-- security <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-security</artifactid> </dependency>--> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-tomcat</artifactid> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <!-- spring boot maven --> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> <configuration> <mainclass>com.withinet.cloud.application</mainclass> <layout>jar</layout> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
add exclusion both spring-boot-starter , spring-boot-starter-web resolve conflict.
<dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter</artifactid> <exclusions> <exclusion> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-logging</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> <exclusions> <exclusion> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-logging</artifactid> </exclusion> </exclusions> </dependency>
Comments
Post a Comment