“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)

Comment From: snicoll

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?

Comment From: caipanjin

@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);
            }

Comment From: snicoll

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.

Comment From: caipanjin

@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.

Comment From: spring-projects-issues

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.

Comment From: spring-projects-issues

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.

Comment From: manishpatelUK

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.

Comment From: mjaverto

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

Comment From: hurelhuyag

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

Comment From: philwebb

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