今天启动服务器的时候遇到问题,但是显示的异常指向和提示却并没有什么软用,百度也找不到类似信息,只能打印 tomcat 日志信息从头到尾看了,最后果然发现问题的症结,因为 eclipse console 虽然也打印 tomcat 日志,但是由于启动的时候太快,很多信息被覆盖了,所以得不到有用信息,而输出日志文件很好的解决了这一问题。
步骤1:
步骤2:
接下来说说我的异常:
九月 15, 2017 10:51:28 上午 org.apache.catalina.loader.WebappClassLoaderBase loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load net.rubyeye.xmemcached.exception.MemcachedDecodeException. The eventual following stack trace is caused 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.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1777)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
at net.rubyeye.xmemcached.impl.MemcachedHandler.checkHeartBeat(MemcachedHandler.java:202)
at net.rubyeye.xmemcached.impl.MemcachedHandler.onSessionIdle(MemcachedHandler.java:182)
at com.google.code.yanf4j.core.impl.AbstractSession.onIdle(AbstractSession.java:194)
at com.google.code.yanf4j.nio.impl.AbstractNioSession.onEvent(AbstractNioSession.java:350)
at com.google.code.yanf4j.nio.impl.Reactor.checkIdle(Reactor.java:496)
at com.google.code.yanf4j.nio.impl.Reactor.checkExpiredIdle(Reactor.java:487)
at com.google.code.yanf4j.nio.impl.Reactor.checkSessionTimeout(Reactor.java:393)
at com.google.code.yanf4j.nio.impl.Reactor.run(Reactor.java:160)
[MMD] 10:51:28,859 ERROR MemcachedHandler:onExceptionCaught:137 - XMemcached network layout exception
java.lang.NoClassDefFoundError: net/rubyeye/xmemcached/exception/MemcachedDecodeException
at net.rubyeye.xmemcached.impl.MemcachedHandler.checkHeartBeat(MemcachedHandler.java:202)
at net.rubyeye.xmemcached.impl.MemcachedHandler.onSessionIdle(MemcachedHandler.java:182)
at com.google.code.yanf4j.core.impl.AbstractSession.onIdle(AbstractSession.java:194)
at com.google.code.yanf4j.nio.impl.AbstractNioSession.onEvent(AbstractNioSession.java:350)
at com.google.code.yanf4j.nio.impl.Reactor.checkIdle(Reactor.java:496)
at com.google.code.yanf4j.nio.impl.Reactor.checkExpiredIdle(Reactor.java:487)
at com.google.code.yanf4j.nio.impl.Reactor.checkSessionTimeout(Reactor.java:393)
at com.google.code.yanf4j.nio.impl.Reactor.run(Reactor.java:160)
Caused by: java.lang.ClassNotFoundException: net.rubyeye.xmemcached.exception.MemcachedDecodeException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
... 8 more
这个问题挺蛋疼的,我以为是memcached的问题,一直在搞配置文件,后来一看Tomcat日志才发现是我自己程序代码的问题:
tomcat 日志:
[MMD] 11:23:55,999 ERROR RoseFilter:initFilterBean:295 - [Rose-1.0.1-20100604@Spring-3.1.3.RELEASE]:params with same name: 'upfile'
java.lang.IllegalArgumentException: params with same name: 'upfile'
at net.paoding.rose.web.paramresolver.ParameterNameDiscovererImpl.getParameterNames(ParameterNameDiscovererImpl.java:107)
at net.paoding.rose.web.paramresolver.MethodParameterResolver.<init>(MethodParameterResolver.java:56)
at net.paoding.rose.web.impl.thread.ActionEngine.compileParamResolvers(ActionEngine.java:120)
at net.paoding.rose.web.impl.thread.ActionEngine.<init>(ActionEngine.java:89)
at net.paoding.rose.web.impl.mapping.TreeBuilder.addAction(TreeBuilder.java:129)
at net.paoding.rose.web.impl.mapping.TreeBuilder.addController(TreeBuilder.java:117)
at net.paoding.rose.web.impl.mapping.TreeBuilder.addModule(TreeBuilder.java:84)
at net.paoding.rose.web.impl.mapping.TreeBuilder.addRoot(TreeBuilder.java:58)
at net.paoding.rose.web.impl.mapping.TreeBuilder.create(TreeBuilder.java:53)
at net.paoding.rose.RoseFilter.prepareMappingTree(RoseFilter.java:439)
at net.paoding.rose.RoseFilter.initFilterBean(RoseFilter.java:279)
at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:194)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4958)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5652)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
上面服务器启动的就不截图了,看这个"params with same name: 'upfile'",终于解决了。