项目部署服务器上就报java.lang.NoClassDefFoundError

Mar 10, 2020 2:23:18 PM org.apache.catalina.core.ApplicationFilterConfig release

SEVERE: Failed to destroy the filter named [jFinal] of type [com.jfinal.core.JFinalFilter]

java.lang.NoClassDefFoundError: net/sf/ehcache/store/chm/SelectableConcurrentHashMap$KeySet

at net.sf.ehcache.store.chm.SelectableConcurrentHashMap.keySet(SelectableConcurrentHashMap.java:478)

at net.sf.ehcache.store.MemoryStore.removeAll(MemoryStore.java:438)

at net.sf.ehcache.store.MemoryStore.flush(MemoryStore.java:460)

at net.sf.ehcache.store.MemoryStore.dispose(MemoryStore.java:451)

at net.sf.ehcache.store.FrontEndCacheTier.dispose(FrontEndCacheTier.java:527)

at net.sf.ehcache.Cache.dispose(Cache.java:2472)

at net.sf.ehcache.CacheManager.shutdown(CacheManager.java:1450)

at com.jfinal.plugin.ehcache.EhCachePlugin.stop(EhCachePlugin.java:94)

at com.jfinal.core.JFinal.stopPlugins(JFinal.java:115)

at com.jfinal.core.JFinalFilter.destroy(JFinalFilter.java:91)

at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:312)

at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:4984)

at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5821)

at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)

at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1135)

at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1598)

at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1524)

at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1784)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:366)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)

at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1500)

at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1671)

at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1681)

at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1649)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.store.chm.SelectableConcurrentHashMap$KeySet

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)

... 26 more


Mar 10, 2020 2:24:32 PM org.apache.catalina.core.ApplicationContext log

INFO: No Spring WebApplicationInitializer types detected on classpath

Mar 10, 2020 2:38:04 PM org.apache.catalina.core.ApplicationFilterConfig release

SEVERE: Failed to destroy the filter named [jFinal] of type [com.jfinal.core.JFinalFilter]

java.lang.NoClassDefFoundError: net/sf/ehcache/store/chm/SelectableConcurrentHashMap$KeySet

at net.sf.ehcache.store.chm.SelectableConcurrentHashMap.keySet(SelectableConcurrentHashMap.java:478)

at net.sf.ehcache.store.MemoryStore.removeAll(MemoryStore.java:438)

at net.sf.ehcache.store.MemoryStore.flush(MemoryStore.java:460)

at net.sf.ehcache.store.MemoryStore.dispose(MemoryStore.java:451)

at net.sf.ehcache.store.FrontEndCacheTier.dispose(FrontEndCacheTier.java:527)

at net.sf.ehcache.Cache.dispose(Cache.java:2472)

at net.sf.ehcache.CacheManager.shutdown(CacheManager.java:1450)

at com.jfinal.plugin.ehcache.EhCachePlugin.stop(EhCachePlugin.java:94)

at com.jfinal.core.JFinal.stopPlugins(JFinal.java:115)

at com.jfinal.core.JFinalFilter.destroy(JFinalFilter.java:91)

at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:312)

at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:4984)

at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5821)

at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)

at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1135)

at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1598)

at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1524)

at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1784)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:366)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)

at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1500)

at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1671)

at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1681)

at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1649)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.store.chm.SelectableConcurrentHashMap$KeySet

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)

... 26 more


Mar 10, 2020 2:39:38 PM org.apache.catalina.core.ApplicationContext log

INFO: No Spring WebApplicationInitializer types detected on classpath


评论区

JFinal

2020-03-10 16:15

缺少 ehcache 依赖,或者有多个 ehcache 版本的依赖,造成冲突

检查打包后的 lib 目录,里面是否有多个 ehcache 版本的 jar 包

逗你玩

2020-03-10 16:28

@JFinal 只有一个ehcache-core 2.6.11

JFinal

2020-03-10 16:35

参考一下这个:
https://www.jianshu.com/p/ee3efc3a9e61?utm_source=oschina-app

有可能是你的 class path 配置有问题,启动脚本里头有一个 CP 变量,这个要指向你的 lib 目录

注意脚本文件的换行字符在 linux 下要是 \n, 在 windows 下要是 \r\n,文档中有过说明:
7、脚本无法使用问题
https://jfinal.com/doc/1-5

逗你玩

2020-03-10 16:37

@JFinal 好的 谢谢

逗你玩

2020-03-10 16:44

奥 对了 我是用的tomcat

chcode

2020-03-10 17:35

找下tomcat WEB_INF/lib 下有没有jar

热门反馈

扫码入社