Spring-boot: java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy

Created on 13 Jun 2016  路  11Comments  路  Source: spring-projects/spring-boot

HELP ME!!!!!!!!!
I have Spring boot project. i run on server Centos.I build and run success.But after run about 15 minute request server.Server die .Here my Log:

Exception in thread "http-nio-7070-exec-6" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
        at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:119)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
        at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
        at ch.qos.logback.classic.Logger.log(Logger.java:765)
        at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:221)
        at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:303)
        at java.util.logging.Logger.log(Logger.java:738)
        at java.util.logging.Logger.doLog(Logger.java:765)
        at java.util.logging.Logger.logp(Logger.java:1041)
        at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:182)
        at org.apache.juli.logging.DirectJDKLog.error(DirectJDKLog.java:148)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1531)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

stackoverflow

Most helpful comment

I also think this is an issue of spring boot itself. I'm getting this error with a repackaged runnable jar with ZIP layout and that class is in classpath at compile time because I have spring-boot-starter-logging dependency. The class is in.m2\repository\ch\qos\logback\logback-classic\1.1.11\logback-classic-1.1.11.jar and it is on the repackaged jar at \BOOT-INF\lib\ but the class loader cannot find it. I'm using spring-boot 1.5.10.RELEASE

I get:

Exception in thread "xxxThread" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
        at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:119)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
        at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
        at ch.qos.logback.classic.Logger.log(Logger.java:765)
        at org.apache.commons.logging.impl.SLF4JLocationAwareLog.error(SLF4JLocationAwareLog.java:216)
        at xxxx(xxxx.java:119)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.spi.ThrowableProxy
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more

LoggingEvent and ThrowableProxy are inside the same jar so if one is loaded and can't see the other class loaded I think it means the former was loaded before some error with the class loader that can't now load the second one when it's needed.

Maybe I need to run this on startup so the class gets loaded:

log.debug("this is really not an error, it's just to initialize the logging subsystem before the classLoader fails", new RuntimeException());

Please help with this issue.

All 11 comments

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.

You might also like to try Googling the error. It throws up this thread on the Logback user list, for example.

Hi. I am also receiving this error.

I could not find anything useful by Googling this issue. I've also looked into these issues #1106 #4968 #5023 .

My environment contains the following:

  • Ubuntu Server 14.04
  • Spring Boot 1.4.0 RC1
  • Oracle JDK 8

I'm using WinSCP to transfer the jar file (using repackage) to the server's local file system after I have shutdown the application using the kill command.

I'm then creating a new unix screen and launching the app using
java -jar springbootapp-tomcat-0.0.1.jar -Xmx 2G &

While still logged into the unix session using SSH, I can hit the application from the web browser. After I detach from the screen and logout of the unix box, I can no longer access the application from the web browser and I receive that same error above. As soon as a I log back into the unix box, and reattach to the screen, sometimes everything works as it should or I receive the error for some endpoints instead of all.

@eburns1148 When you exit your SSH session, it'll kill the app. You need to use something like nohup to keep it running.

@wilkinsona I just ran the command in a unix screen and without:

nohup java -jar springbootapp-tomcat-0.0.1.jar -Xmx 2G &

Same results after detach and logout. The application is still running as it always has, but still receiving that error.

@eburns1148 Sorry to hear that didn't help, but GitHub issues, particularly closed ones, aren't the right place to get some help. Please consider asking on Stack Overflow or chatting on Gitter instead.

See also #6683

@hoanghunguet can you please say how you solved this issue ?

I also think this is an issue of spring boot itself. I'm getting this error with a repackaged runnable jar with ZIP layout and that class is in classpath at compile time because I have spring-boot-starter-logging dependency. The class is in.m2\repository\ch\qos\logback\logback-classic\1.1.11\logback-classic-1.1.11.jar and it is on the repackaged jar at \BOOT-INF\lib\ but the class loader cannot find it. I'm using spring-boot 1.5.10.RELEASE

I get:

Exception in thread "xxxThread" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
        at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:119)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
        at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
        at ch.qos.logback.classic.Logger.log(Logger.java:765)
        at org.apache.commons.logging.impl.SLF4JLocationAwareLog.error(SLF4JLocationAwareLog.java:216)
        at xxxx(xxxx.java:119)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.spi.ThrowableProxy
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more

LoggingEvent and ThrowableProxy are inside the same jar so if one is loaded and can't see the other class loaded I think it means the former was loaded before some error with the class loader that can't now load the second one when it's needed.

Maybe I need to run this on startup so the class gets loaded:

log.debug("this is really not an error, it's just to initialize the logging subsystem before the classLoader fails", new RuntimeException());

Please help with this issue.

As it makes test fails randomly, I think it's very important to find reason behind and how to fix it (on user-side or framework-side)

@loganmzz Perhaps you'd like to do something constructive and help to find the reason behind the problem? You are the first person in this issue to mention test failures so perhaps you actually have a different problem? Either way, if you have a sample project that can reproduce the failure, please open a new issue and we'll take a look.

@wilkinsona I was thinking it happens during test execution (and SpringBootTest server shutdown). But it happens on server side deployed into a Docker container during initialization (container logs are printed out on test failure at end). It occurs sometimes (~3/10) on CI server. As I use some private company librairies, I need to check it happens:

1) outside CI server
2) outside Docker
3) without private librairies

I will try to investigate on this later (maybe tomorrow or next week)

Was this page helpful?
0 / 5 - 0 ratings