2012-11-15 50 views
-1

我有一個運行在Tomcat 6上的Spring集成應用程序。它有一個message-driven-channel-adapter,它與遠程Active MQ服務器通信。到目前爲止,我能夠完成我的工作。Spring集成異常關閉tomcat服務器時

然而,當我關閉Tomcat我得到以下異常不斷地循環的卡塔利娜日誌:

Exception in thread "org.springframework.jms.listener.DefaultMessageListenerContainer#0-178" Exception in thread "org.springframework.jms.listener.DefaultMessageListenerContainer#0-179" 

java.lang.NullPointerException 
    at org.apache.log4j.LogManager.getLogger(LogManager.java:188) 
    at org.apache.log4j.Logger.getLogger(Logger.java:104) 
    at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:289) 
    at org.apache.commons.logging.impl.Log4JLogger.trace(Log4JLogger.java:166) 
    at org.springframework.jms.support.JmsUtils.closeMessageConsumer(JmsUtils.java:158) 
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1111) 
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:971) 
    at java.lang.Thread.run(Thread.java:722) 

java.lang.NullPointerException 
    at org.apache.log4j.LogManager.getLogger(LogManager.java:188) 
    at org.apache.log4j.Logger.getLogger(Logger.java:104) 
    at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:289) 
    at org.apache.commons.logging.impl.Log4JLogger.trace(Log4JLogger.java:166) 
    at org.springframework.jms.support.JmsUtils.closeSession(JmsUtils.java:115) 
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1112) 
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:971) 
    at java.lang.Thread.run(Thread.java:722) 
Nov 13, 2012 7:23:37 PM org.apache.catalina.loader.WebappClassLoader loadClass 
INFO: Illegal access: this web application instance has been stopped already. Could not load org.apache.log4j.spi.VectorWriter. The eventual following stack trace is ca 
used by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. 
java.lang.IllegalStateException 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273) 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) 
    at org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:154) 
    at org.apache.log4j.Category.forcedLog(Category.java:388) 
    at org.apache.log4j.Category.log(Category.java:853) 
    at org.apache.commons.logging.impl.Log4JLogger.warn(Log4JLogger.java:234) 
    at org.springframework.jms.listener.DefaultMessageListenerContainer.handleListenerSetupFailure(DefaultMessageListenerContainer.java:831) 
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:981) 
    at java.lang.Thread.run(Thread.java:722) 

你們是否有這回合什麼想法?在關閉Tomcat之前是否需要關閉或銷燬Spring上下文?

感謝您的幫助

感謝, Keth

+0

你是直接還是間接使用apache速度? 這個tomcat上託管了多少個應用程序? – dharam

+0

出於好奇,爲什麼關於速度的問題? – Crowie

回答

0

嗯,看起來,你是正確的:

我是否需要關閉或破壞Spring上下文之前,我關閉Tomcat?

從春天JSM源代碼,它看起來像你的Tomcat關閉其log4j.LogManager早,比春季停止其上下文。

相關問題