this web application instance has been stopped already. Could not load [org.apache.zookeeper【端口问题】
报错情况:// [Curator-ConnectionStateManager-0] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could n
·
报错情况:
// [Curator-ConnectionStateManager-0] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [org.apache.zookeeper.ZooKeeperTestable]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org.apache.zookeeper.ZooKeeperTestable]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1295)
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1283)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1148)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1109)
at org.apache.zookeeper.ZooKeeper.getTestable(ZooKeeper.java:1317)
错误分析
1.报错说的是WEB项目已经停止,无法启动
解决的方法:网上大部分都是说
找到tomcat目录下conf文件夹下的server.xml
把reloadble的属性值设为:reloadable=“false”
本人经历:我去找了一下我的tomcat的server文件里面并没有这个属性,所以问题不在此(如果找到的同学修改前记得备份)
2.这个项目使用的是zookeeper 和 dubbo ,可能是这个两项的依赖处理问题
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>4.1.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.5.6</version>
</dependency>
b站上有人说可能是版本匹配不上,我根据他的提示,加上了exclusion和我的zookeeper版本3.5.6
但是都还是不行。
最终解决:
最后比对代码发现是自己指定的注册中心的端口错了
<dubbo:registry address="zookeeper://localhost:2181"/>
这里的2181是我们注册中的端口号,我们打开zkServer.cmd文件成功后是可以看到2181端口的。修改之后我的tomcat就启动成功了
更多推荐
已为社区贡献2条内容
所有评论(0)