Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logback to the latest version #865

Closed
mkpaz opened this issue Sep 14, 2017 · 3 comments
Closed

Update logback to the latest version #865

mkpaz opened this issue Sep 14, 2017 · 3 comments

Comments

@mkpaz
Copy link

mkpaz commented Sep 14, 2017

On my PC application doesn't start with logback v1.1.7. Maybe it's because my PC has no DNS configured (I work behind proxy). Maybe it's a logback bug. I don't know. Here is the exception:

Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.NoSuchMethodError: ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty()V
	at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:65)
	at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:269)
	at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:145)
	at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:128)
	at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
	at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
	at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
	at org.jooby.Err$DefHandler.<init>(Err.java:279)
	at org.jooby.Jooby.lambda$bootstrap$50(Jooby.java:2942)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
	at com.google.inject.spi.Elements.getElements(Elements.java:110)
	at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
	at com.google.inject.Guice.createInjector(Guice.java:99)
	at com.google.inject.Guice.createInjector(Guice.java:84)
	at org.jooby.Jooby.lambda$new$0(Jooby.java:884)
	at org.jooby.Jooby.bootstrap(Jooby.java:2948)
	at org.jooby.Jooby.start(Jooby.java:2161)
	at org.jooby.Jooby.start(Jooby.java:2142)
	at org.jooby.Jooby.run(Jooby.java:2072)
	at site.App.main(App.java:26)
	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:498)
	at org.jooby.run.Main.lambda$startApp$1(Main.java:427)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

To fix this problem I need either to delete logback.xml from conf/ dir, or force logback to v1.2.3. Then all works just fine.

@jknack
Copy link
Member

jknack commented Sep 14, 2017

Upgrade sounds good.

Run mvn dependencies:tree and check if there is a dependency that fetches a newer version of logback and result in this runtime error.

@mkpaz
Copy link
Author

mkpaz commented Sep 14, 2017

No, I just began to work on my project, so it's not so different from starter for now.

[INFO] test:test-site-jooby:jar:0.1-SNAPSHOT
[INFO] +- org.jooby:jooby-jackson:jar:1.1.3:compile
[INFO] |  +- org.jooby:jooby:jar:1.1.3:compile
[INFO] |  |  +- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] |  |  +- ch.qos.logback:logback-classic:jar:1.1.7:compile <<< CAUSE EXCEPTION
[INFO] |  |  |  \- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] |  |  +- com.typesafe:config:jar:1.3.1:compile
[INFO] |  |  +- io.javaslang:javaslang:jar:2.0.4:compile
[INFO] |  |  |  \- io.javaslang:javaslang-match:jar:2.0.4:compile
[INFO] |  |  +- com.google.guava:guava:jar:21.0:compile
[INFO] |  |  \- com.google.inject.extensions:guice-multibindings:jar:4.1.0:compile
[INFO] |  |     \- com.google.inject:guice:jar:4.1.0:compile
[INFO] |  |        +- javax.inject:javax.inject:jar:1:compile
[INFO] |  |        \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.8.3:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.3:compile
[INFO] |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.8.3:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.3:compile
[INFO] |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.8.3:compile
[INFO] \- org.jooby:jooby-netty:jar:1.1.3:compile
[INFO]    +- io.netty:netty-transport:jar:4.1.11.Final:compile
[INFO]    |  \- io.netty:netty-buffer:jar:4.1.11.Final:compile
[INFO]    +- io.netty:netty-resolver:jar:4.1.11.Final:compile
[INFO]    +- io.netty:netty-codec:jar:4.1.11.Final:compile
[INFO]    +- io.netty:netty-codec-http:jar:4.1.11.Final:compile
[INFO]    +- io.netty:netty-codec-http2:jar:4.1.11.Final:compile
[INFO]    +- io.netty:netty-common:jar:4.1.11.Final:compile
[INFO]    +- io.netty:netty-handler:jar:4.1.11.Final:compile
[INFO]    +- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO]    +- io.netty:netty-transport-native-epoll:jar:4.1.11.Final:compile
[INFO]    |  \- io.netty:netty-transport-native-unix-common:jar:4.1.11.Final:compile
[INFO]    +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.11.Final:compile
[INFO]    \- io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:1.1.33.Fork26:compile

Since I inherit my pom from jooby-modules it's quite easy to change logback version through overriding property placeholder: <logback-classic.version>1.2.3</logback-classic.version>

@jknack jknack closed this as completed in 3197a66 Sep 25, 2017
@vishrantgupta
Copy link

I had an older version of logback switching to 1.2.3 fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants