linux下启动tomcat后,在catalina.log文件中显示项目启动ok,但是访问项目,访问不到。
访问项目后catalina.log会出现如下异常:
Feb 27, 2016 11:45:40 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load net.sf.ehcache.store.compound.CompoundStore$KeySet. 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.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at net.sf.ehcache.store.compound.CompoundStore.keySet(CompoundStore.java:216)
at net.sf.ehcache.store.compound.factories.DiskStorageFactory$DiskExpiryTask.run(DiskStorageFactory.java:690)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
这个异常在网上查了,说是tomcat的进程未关闭导致的,也没有实质的解决办法。
在localhost.log中会发现有如下异常:
net.sf.ehcache.CacheException: Problem starting listener for RMICachePeer //localhost:40001/eternalCache. Initial cause was no such object in tabl
这表示40001端口号被占用了,导致监听无法加载
解决方法:
命令: lsof -i:40001 查出占用40001端口的pid
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 20896 root 170u IPv6 310625 0t0 TCP *:40001 (LISTEN)
命令: kill 20896 杀死这个pid
再启动tomcat就可以了
这个问题困扰我半天的时候,希望能给我大家带来帮助。