Comments (3)
@aheusingfeld Eureka itself has a hard dependency on log4j that we are trying to solve. (see #3) spring-boot-starter-logging
is already excluded by spring-cloud-netlifx-eureka-server
. I don't see logback-classic in the mvn dependency:tree output. Are you seeing a specific problem?
from spring-cloud-netflix.
Are you seeing a specific problem?
yes. I have a simple Gradle 2.0 build.gradle file like the following:
buildscript {
repositories {
maven { url "http://repo.spring.io/libs-release" }
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.1.7.RELEASE'
}
}
apply plugin: 'java'
apply plugin: 'spring-boot'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
version = '1.0'
repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-snapshot" }
}
dependencies {
compile 'org.springframework.cloud:spring-cloud-starters:1.0.0.BUILD-SNAPSHOT'
compile 'org.springframework.cloud:spring-cloud-starter-eureka-server:1.0.0.BUILD-SNAPSHOT'
testCompile 'org.springframework.boot:spring-boot-starter-test:1.1.7.RELEASE'
}
When I build and run this via java -jar build/libs/eureka-server-1.0.jar
, I get the following error
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Volumes/innoq-dev/microservicesjvm/eureka-server/build/libs/eureka-server-1.0.jar!/lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Volumes/innoq-dev/microservicesjvm/eureka-server/build/libs/eureka-server-1.0.jar!/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory) Object of class [org.slf4j.impl.Log4jLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext
at org.springframework.util.Assert.isInstanceOf(Assert.java:339)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:93)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSensibleDefaults(AbstractLoggingSystem.java:62)
at org.springframework.boot.logging.AbstractLoggingSystem.beforeInitialize(AbstractLoggingSystem.java:45)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:69)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:135)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100)
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:54)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:276)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
Therefore I had to manually exclude logback classic in the build.gradle like the following
compile ('org.springframework.cloud:spring-cloud-starter-eureka-server:1.0.0.BUILD-SNAPSHOT') {
exclude module: 'logback-classic'
}
Another problem is that the transitive dependencies of the spring-cloud-starters
don't seem to be loaded, but that's a different topic which is probably also the cause for #22
from spring-cloud-netflix.
It should be clear from #22 that it is caused by Jersey classpath scanning, and the fix is explained (and exemplified for Maven in a sample). But "spring-boot-starters" doesn't have any transitive dependencies, so it's not surprising that they aren't being used. Did you mean to use "spring-boot-starter" (singular)? You do sometimes have to do some manual dependency exclusion when you work with Gradle, but if you only want to run the eureka server it should be enough to just depend on the "spring-cloud-starter-eureka-server".
from spring-cloud-netflix.
Related Issues (20)
- Discovery client can't register -> 401 error HOT 3
- cannot register to eureka server when spring.cloud.refresh.enabled is false HOT 5
- Improve documentation on required HTTP client dependencies HOT 9
- Before eureka is registered, InstancePreRegisteredEvent will not be published. HOT 1
- Dependency vulnerability (org.codehaus.jettison) HOT 3
- Hello All, HOT 1
- not able to exceute HOT 1
- The API '/serverinfo/statusoverrides' from class ServerInfoResource don't work. HOT 1
- eureka: improve single-server experience
- Spring cloud ribbon loadbalancer error - org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/cloud/commons/httpclient/HttpClientConfiguration$OkHttpClientConfiguration.class] cannot be opened because it does not exist HOT 1
- Missing observability support in RestTemplateTransportClientFactory HOT 2
- NullPointerException in EurekaClient when jeresey-client lib is found on the class path HOT 1
- Support Spring RestClient as TransportClientFactory HOT 3
- Cannot invoke "org.springframework.cloud.netflix.eureka.CloudEurekaClient.getApplications() HOT 2
- Jersey3DiscoveryClientOptionalArgs may be configured with TlsProperties in EurekaServerAutoConfiguration.java HOT 1
- UnresolvedAddressException when using webClient.get() to get from a discovery eureka client HOT 4
- When shutting down after 4.1.1, an exception occurs while unregistering HOT 6
- No such host is known (swagger-service) HOT 5
- xstream, woodstox and guava dependencies vulnerabilities HOT 1
- Eureka Service Discovery, after a network failure, updates the client status to DOWN, but when the HEARTBEAT is done from the client it does not change status to UP
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-cloud-netflix.