iT邦幫忙

0

apache-tomcat 網站重開機後出錯

  • 分享至 

  • xImage

沒有更動apache-tomcat設定,也沒有動到網站資料。

重開機之後其中有一個網站出錯,LOG如下 :

/usr/apache-tomcat-8.5.12/logs/catalina.2020-09-02.log

02-Sep-2020 13:12:05.857 SEVERE [www.testing1.com.tw-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
02-Sep-2020 13:12:05.858 SEVERE [www.testing1.com.tw-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
02-Sep-2020 13:12:05.872 WARNING [www.testing1.com.tw-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:

參考網頁資訊,是說要另外寫一個 logging.properties 擷取資訊,試著做了,也沒有看到任何新的偵錯訊息。

請問各位先進,我可以往哪個方向去試著解決問題 ?


現在成功將錯誤印出來了,內容如下 :

02-Sep-2020 19:54:21.772 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
 java.lang.IllegalStateException: Cannot load configuration class: com.withum.testing1.web.MVCConfiguration
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:403)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:249)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:281)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:125)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4754)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5216)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1386)
        at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1350)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1586)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:280)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1164)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1388)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1360)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassFormatError: Extra bytes at the end of class file com/withum/testing/web/MVCConfiguration
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2277)
        at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1254)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)
        at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:401)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:392)
        ... 21 more

最後是找到網站目錄 /data/webapps_testing/testing/WEB-INF/classes/com/withum/caishen/web/MVCConfiguration.class 載入有問題。
問題點好像看到是這個了,但是這個已經是一兩年沒動的東西了。臨時報這個問題。不知道要怎麼辦


解決MVCConfiguration.class,網站就開起來了。感謝 !

jeles51 iT邦研究生 3 級 ‧ 2020-09-02 16:49:15 檢舉
對 tomcat 不熟,
可以試著 GOOGLE "tomcat This is very likely to create a memory leak"
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
richardsuma
iT邦大師 1 級 ‧ 2020-09-02 18:15:31
最佳解答

試試看:
https://www.itread01.com/content/1542789913.html

但是你為什麼會重新開機呢?
會不會你做了什麼動作造成的?

snameless iT邦新手 4 級 ‧ 2020-09-02 20:24:08 檢舉

為了做備份跟範本需要關機才能做

我要發表回答

立即登入回答