29

while starting my weblogic(having my app war file containing logback-classic-1.0.1.jar),i am getting below exception.Any suggestion ?

<Sep 9, 2015 9:27:13 AM UTC> <Warning> <Common> <BEA-000632> <Resource Pool "JDBC Data Source-0" shutting down, ignoring 3 resources still in use by applications..>
Exception in thread "Thread-12" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
        at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:125)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:468)
        at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:424)
        at ch.qos.logback.classic.Logger.log(Logger.java:824)
        at org.apache.commons.logging.impl.SLF4JLocationAwareLog.error(SLF4JLocationAwareLog.java:225)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:415)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:114)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:58)
        at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:213)
        at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:66)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
        ................
        at java.lang.Thread.run(Thread.java:701)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.spi.ThrowableProxy
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:52)
        ... 18 more
Exception in thread "Thread-18" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
        at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:125)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:468)
        at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:424)
        at ch.qos.logback.classic.Logger.log(Logger.java:824)
        at org.apache.commons.logging.impl.SLF4JLocationAwareLog.error(SLF4JLocationAwareLog.java:225)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:415)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:114)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:58)
        at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:213)
        at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:66)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
        .......................
        at java.lang.Thread.run(Thread.java:701)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.spi.ThrowableProxy
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:52)
    ... 18 more
user3198603
  • 5,528
  • 13
  • 65
  • 125

9 Answers9

34

This error happens when spring applications jar are rebuilt, removed, or updated during execution.

Ref: https://github.com/spring-projects/spring-boot/issues/4968

ton
  • 3,827
  • 1
  • 42
  • 40
10

I have been getting this same error when breaking out (ctrl-c) from Dropwizard server, I finally learned why I get it.

My Dropwizard is build into one fat jar, that I build with Gradle, and when running server on my local computer I run it directly from build/libs/...fat.jar

So this exception occurs when I have changed source code, built app-server again, and Gradle has overwritten the same jar I am currently running with "java -jar ...", so it's not that weird that classes that haven't been used before that session will not load ok :)

Render
  • 2,199
  • 2
  • 16
  • 14
7

This type of exception occurs when your classpath does not contain this class.
If the jar's class is in your classpath, you pay attention to what classpath application you using at runtime. Indeed, often, classpath can be overwritten during runtime, or simply you can use a different one (for example, in a startup script).

2

For us, appears this meant "you are running out of file handles, increase your open file handle limit." (too many sockets were being created, using them all up). Credit to the original answer here.

Other things I've seen: make sure your spring boot is at least 1.3.8

Also make sure the jars underneath aren't being overwritten/changed/unstable file system. FWIW.

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
2

I got this runtime error in my spring boot app using Spring Boot version 2.3.5.RELEASE. Resolved by adding following dependencies in my build.gradle file.

compile group: 'ch.qos.logback', name: 'logback-classic', version:  '1.2.3'
compile group: 'ch.qos.logback', name: 'logback-core', version:  '1.2.3'
Flame239
  • 1,274
  • 1
  • 8
  • 20
akarahman
  • 235
  • 2
  • 15
1

Two options I see(not enough information yet): 1. It happens right upon loading, I bet for classpath, see answers above. 2. It happens after some time, when app is runnig(my case), read next paragraphs.

When I got class not found errors and also have the same error like you right now, quite offten is issued with no space left on device aka full disk, full memory.

My environment, is spring boot, logback is included automagicaly, in maven have repackage, so wverithing I need is included. This error occures after my app is runnig for 20 minutes or so, is has thousands of threads. If you do not limit memory for your virtual maschine, it can get very high even if it is not necessary.

Once(2 days ago) I spend 3 hours looking around claspath stuf, ... issue was full disk

1

If you exactly ensure that logback-class and logback-core already are in your classpath. See below. In your Logback.xml, you need add debug="true"

<configuration debug="true">

I encountered the problem 'java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy' in my tomcat. However, after adding debug = 'true', anything is ok.

Cheng
  • 316
  • 3
  • 9
  • Solved my problem with weblogic.application.ModuleException: java.lang.ClassNotFoundException: ch.qos.logback.core.status.WarnStatus on WebLogic 12.2.1.0. – anre Sep 26 '19 at 18:39
0

The class that is missing definitely exists in the JAR you have, I checked logback-classic-1.0.1.jar:

2012-03-07 07:34:18 .....         4729         2018  ch\qos\logback\classic\spi\ThrowableProxy.class

Make sure your classpath is set up correctly. By the way: if possible update logback because this version is 3 years old.

Laurel
  • 5,965
  • 14
  • 31
  • 57
Marged
  • 10,577
  • 10
  • 57
  • 99
  • How i can i check whats the classpath weblogic is using ? – user3198603 Sep 13 '15 at 08:13
  • Also war file contains logback-classic-1.0.1.jar and other jar files. Classes are getting loaded from jar file but not from logback-classic-1.0.1.jar. Is that possible ? – user3198603 Sep 13 '15 at 08:15
-1

I solved this problem by doing "mvn install" instead of "mvn clean install".

Aliuk
  • 1,249
  • 2
  • 17
  • 32