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

A java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy was thrown when killing my app #4968

Closed
caipanjin opened this issue Jan 19, 2016 · 10 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@caipanjin
Copy link

“kill pid” to stop my app throws the exception as below:

Exception in thread "Thread-7" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
        at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:121)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:440)
        at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396)
        at ch.qos.logback.classic.Logger.log(Logger.java:788)
        at org.apache.commons.logging.impl.SLF4JLocationAwareLog.warn(SLF4JLocationAwareLog.java:192)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:978)
        at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:901)
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 19, 2016
@snicoll
Copy link
Member

snicoll commented Jan 19, 2016

It looks like logback has been shutdown when the context needs to log something. Could you please describe what you're doing in more details. At the very minimum the Spring Boot version that you are using and the dependencies you're using. It is always better to provide a sample project that reproduces the issue.

Relates to #4657?

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 19, 2016
@caipanjin
Copy link
Author

@snicoll I use version 1.3.1.RELEASE, it seems when I shutdown my app, the method doClose in AbstractApplicationContext catching an exception and try to print a log (line:978):

protected void doClose() {
        if (this.active.get() && this.closed.compareAndSet(false, true)) {
            if (logger.isInfoEnabled()) {
                logger.info("Closing " + this);
            }

            LiveBeansView.unregisterApplicationContext(this);

            try {
                // Publish shutdown event.
                publishEvent(new ContextClosedEvent(this));
            }
            catch (Throwable ex) {
                logger.warn("Exception thrown from ApplicationListener handling ContextClosedEvent", ex);
            }

            // Stop all Lifecycle beans, to avoid delays during individual destruction.
            try {
                getLifecycleProcessor().onClose();
            }
            catch (Throwable ex) {
line:978                logger.warn("Exception thrown from LifecycleProcessor on context close", ex);
            }

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 19, 2016
@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jan 19, 2016
@snicoll
Copy link
Member

snicoll commented Jan 19, 2016

it seems when I shutdown my app,

The whole point I am trying to make is that mine doesn't so please help us out by providing a way for us to reproduce the problem.

@caipanjin
Copy link
Author

@snicoll sorry about that.My app uses lots of other frameworks. I am trying to remove them and found if I can reproduce the problem.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 19, 2016
@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jan 19, 2016
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jan 26, 2016
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Feb 2, 2016
@philwebb philwebb added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Feb 2, 2016
@manishpatelUK
Copy link

manishpatelUK commented Jan 20, 2018

I'm getting the same intermittently when I try and call the shutdown actuator endpoint. Oddly, I never get it when I do a curl call from the command line. However if I do the same via an ANT script (bash -c ...) from a remote Jenkins server, 1 out of 3 times I see this issue pop up. Incidentally, the shutdown never seems to work in this case either.

I'm on 1.4.7.RELEASE

EDIT: I think I may have found the problem on my side though. My script for deployment would deploy the fat jar first, and then do a restart (i.e. call /shutdown and then start the process again). I reckon that was breaking the class loader, since the initial binary is gone. I changed this so that the /shutdown is called first, and then the binary replaced. So far so good.

@wilkinsona wilkinsona removed the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jan 22, 2018
@mjaverto
Copy link

mjaverto commented May 3, 2018

We had this issue today and realized it was that we removed the JAR after Spring already started so similar to @manishpatelUK 's feedback.

@hurelhuyag
Copy link

Similar exception happening here. But I'm not killing or touching my app. It's just happening frequently.
Exception in thread "http-nio-8083-exec-2" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy

@philwebb
Copy link
Member

@hurelhuyag If you have a consistent way to reproduce the issue, please provide a sample here that we can run and debug.

@bclozel bclozel added the status: invalid An issue that we don't feel is valid label Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

9 participants