weixin_42594204
夏沫微凉_L
2019-05-07 15:34
采纳率: 66.7%
浏览 2.1k
已采纳

java.lang.NoClassDefFoundError怎么处理?

Servlet.service() for servlet [dispatcher] in context with path [/platform] threw exception [Filtered request failed.] with root cause
java.lang.NoClassDefFoundError: Could not initialize class com.platform.cache.J2CacheUtils
    at com.platform.shiro.CluterShiroSessionDao.setShiroSession(CluterShiroSessionDao.java:57)
    at com.platform.shiro.CluterShiroSessionDao.doCreate(CluterShiroSessionDao.java:23)
    at org.apache.shiro.session.mgt.eis.AbstractSessionDAO.create(AbstractSessionDAO.java:116)
    at org.apache.shiro.session.mgt.eis.CachingSessionDAO.create(CachingSessionDAO.java:184)
    at org.apache.shiro.session.mgt.DefaultSessionManager.create(DefaultSessionManager.java:177)
    at org.apache.shiro.session.mgt.DefaultSessionManager.doCreateSession(DefaultSessionManager.java:158)
    at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.createSession(AbstractValidatingSessionManager.java:136)
    at org.apache.shiro.session.mgt.AbstractNativeSessionManager.start(AbstractNativeSessionManager.java:99)
    at org.apache.shiro.mgt.SessionsSecurityManager.start(SessionsSecurityManager.java:152)
    at org.apache.shiro.subject.support.DelegatingSubject.getSession(DelegatingSubject.java:336)
    at org.apache.shiro.subject.support.DelegatingSubject.getSession(DelegatingSubject.java:312)
    at org.apache.shiro.web.util.WebUtils.saveRequest(WebUtils.java:607)
    at org.apache.shiro.web.filter.AccessControlFilter.saveRequest(AccessControlFilter.java:208)
    at org.apache.shiro.web.filter.AccessControlFilter.saveRequestAndRedirectToLogin(AccessControlFilter.java:191)
    at org.apache.shiro.web.filter.authc.FormAuthenticationFilter.onAccessDenied(FormAuthenticationFilter.java:168)
    at org.apache.shiro.web.filter.AccessControlFilter.onAccessDenied(AccessControlFilter.java:133)
    at org.apache.shiro.web.filter.AccessControlFilter.onPreHandle(AccessControlFilter.java:162)
    at org.apache.shiro.web.filter.PathMatchingFilter.isFilterChainContinued(PathMatchingFilter.java:203)
    at org.apache.shiro.web.filter.PathMatchingFilter.preHandle(PathMatchingFilter.java:178)
    at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:131)
    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
    at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
    at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
    at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
    at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

6条回答 默认 最新

  • que1218
    que1218 2020-04-22 14:30
    已采纳

    我猜你在用 微同商城(微信商城) 开源版吧 刚好今天我也用了 也报了这个错 发现是 com.platform.cache.J2CacheUtils 的 private static CacheChannel cache = J2Cache.getChannel() 初始化失败 cache为null了 在 platform\platform-admin\src\main\resources\j2cache.properties 里面配置一下 redis.hosts 就好了

    点赞 2 评论
  • weixin_41599103
    MTLDDB 2019-05-07 16:07

    上下文路径,找不到类,是否类名错误,或环境配置错误。

    点赞 评论
  • asdf3301
    asdf3301 2019-05-07 17:01

    缺少依赖jar包·················

    点赞 评论
  • wojiushiwo945you
    毕小宝 2019-05-08 09:19

    com.platform.cache.J2CacheUtils 这个是哪个第三方包,看看 pom.xml 配置的依赖 scope 类型是什么。

    点赞 评论
  • qq_18630487
    真-酸辣土豆丝 2019-05-09 14:34

    如果确定包存在,maven clean install

    点赞 评论
  • weixin_42452027
    创业斑马线 2019-05-15 02:08

    感觉问题查找下过滤器或配置管理器中的类问题

    点赞 评论

相关推荐