java.lang.IllegalStateException: Failed to register dubbo://139.224.33.130:20881
1、遇到的问题
java.lang.IllegalStateException: Failed to register dubbo://10.3.5.176:20880
2、解决办法:
第一步:
1、先检查是否导入了项目所需要的全部Jar包,一般情况下是因为缺少某一个包导致,猜现在是缺少common-pool.jar这个jar包,发现项目里面有这个包;
2、检查导入的jar包的版本对不对 ,版本不对也会导致这样的问题;
3、检查路径是否正确,有些时候applicationContext.xml 这个文件找不到,要放到classes下面。寻找报错的文件的路径与配置信息是否正确;第二步:
1、先查看tomcat控制台,看看是否有错误,如果出现严重之类的告警,基本会影响后面的应用;
2、发现问题后,打开Tomcat的日志记录,一般能够找到真正的原因;
3、根据原因解决问题;第三步:重新检出项目后部署,依旧不能解决问题;
第四步:找同事拷贝下能运行的本项目代码导入到MyEclipse里运行依旧报错相同错误;
第五步:重新解压Tomcat包重新配置Tomcat后运行,问题解决;
总结:错误原因为运行时多个编写程序软件同一个项目共用一个Tomcat,导致里面配置冲突。
其中我遇到的问题是复制域名时,多了个/ ,删除掉就好了。
其他问题
Error:Zookeeper is not connected yet!
连接Zookeeper注册中心时,出现Zookeeper is not connected yet!
原因:
1.pom.xml引入的坐标版本与服务器的Zookeeper版本不一致
2.linux的防火墙未关闭
com.alibaba.dubbo.rpc.RpcException: Failed to register dubbo
java.lang.IllegalStateException: Failed to register dubbo
Caused by: java.lang.IllegalStateException: Zookeeper is not connected yet!
如果你是在Linux下开启的Zookeeper,出现以上三个错误,如果实在找不到错误的话
试试在Linux命令行关闭防火墙(我就是没有关闭防火墙排错排了两个多小时,最后一关闭防火墙就好了,心态炸了)。
具体操作:
关闭防火墙Linux命令:service iptables stop
运行Tomcat时若出现Address already in use: JVM_Bind 端口被占用,一般使用下面几个办法可以解决:
假设端口为1099
1.启动cmd, 执行命令netstat -ano|findstr 1099 ,会查询出占用端口号的进程号,这时候执行命令
taskkill -f -pid 进程号 杀死进程,然后重启Tomcat即可解决
2.若方法一查询不到进程,(假设使用IDEA)则在Run- Edit Configurations中删掉添加的Tomcat,之后再重新配置Tomcat及其artifacts等,可解决
3.若还是不行,Ctrl Shift Delete 打开资源管理器,关掉Idea和Java jvm的进程,重新打开idea 尝试运行
4,关机重启
一般情况下 方法一即可解决,其次方法二
附件:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloServiceImpl' defined in file [D:\code\IdeaProjects\dubboDemo\dubboDemo-provider\target\classes\com\nxg\service\impl\HelloServiceImpl.class]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Failed to register dubbo://192.168.124.4:20881/com.nxg.service.HelloService?anyhost=true&application=dubboDemo_provider&dubbo=2.6.0&generic=false&interface=com.nxg.service.HelloService&methods=sayHello&pid=22004&side=provider×tamp=1645759186327 to registry 139.224.33.130:9090, cause: Failed to register dubbo://192.168.124.4:20881/com.nxg.service.HelloService?anyhost=true&application=dubboDemo_provider&dubbo=2.6.0&generic=false&interface=com.nxg.service.HelloService&methods=sayHello&pid=22004&side=provider×tamp=1645759186327 to zookeeper zookeeper://139.224.33.130:9090/com.alibaba.dubbo.registry.RegistryService?application=dubboDemo_provider&dubbo=2.6.0&interface=com.alibaba.dubbo.registry.RegistryService&pid=22004×tamp=1645759186306, cause: Zookeeper is not connected yet!
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:587)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:409)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Failed to register dubbo://192.168.124.4:20881/com.nxg.service.HelloService?anyhost=true&application=dubboDemo_provider&dubbo=2.6.0&generic=false&interface=com.nxg.service.HelloService&methods=sayHello&pid=22004&side=provider×tamp=1645759186327 to registry 139.224.33.130:9090, cause: Failed to register dubbo://192.168.124.4:20881/com.nxg.service.HelloService?anyhost=true&application=dubboDemo_provider&dubbo=2.6.0&generic=false&interface=com.nxg.service.HelloService&methods=sayHello&pid=22004&side=provider×tamp=1645759186327 to zookeeper zookeeper://139.224.33.130:9090/com.alibaba.dubbo.registry.RegistryService?application=dubboDemo_provider&dubbo=2.6.0&interface=com.alibaba.dubbo.registry.RegistryService&pid=22004×tamp=1645759186306, cause: Zookeeper is not connected yet!
at com.alibaba.dubbo.registry.support.FailbackRegistry.register(FailbackRegistry.java:149)
at com.alibaba.dubbo.registry.integration.RegistryProtocol.register(RegistryProtocol.java:116)
at com.alibaba.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:135)
at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:66)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:91)
at com.alibaba.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:505)
at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:357)
at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:316)
at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:215)
at com.alibaba.dubbo.config.spring.AnnotationBean.postProcessAfterInitialization(AnnotationBean.java:181)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:437)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579)
... 20 more
Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to register dubbo://192.168.124.4:20881/com.nxg.service.HelloService?anyhost=true&application=dubboDemo_provider&dubbo=2.6.0&generic=false&interface=com.nxg.service.HelloService&methods=sayHello&pid=22004&side=provider×tamp=1645759186327 to zookeeper zookeeper://139.224.33.130:9090/com.alibaba.dubbo.registry.RegistryService?application=dubboDemo_provider&dubbo=2.6.0&interface=com.alibaba.dubbo.registry.RegistryService&pid=22004×tamp=1645759186306, cause: Zookeeper is not connected yet!
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:112)
at com.alibaba.dubbo.registry.support.FailbackRegistry.register(FailbackRegistry.java:136)
... 33 more
Caused by: java.lang.IllegalStateException: Zookeeper is not connected yet!
at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkClientWrapper.createPersistent(ZkClientWrapper.java:98)
at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient.createPersistent(ZkclientZookeeperClient.java:61)
at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:63)
at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:57)
at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:57)
at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:57)
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:110)
... 34 more
二月 25, 2022 11:20:16 上午 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
二月 25, 2022 11:20:16 上午 org.apache.catalina.core.StandardContext startInternal
严重: Context [] startup failed due to previous errors
二月 25, 2022 11:20:16 上午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
二月 25, 2022 11:20:16 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [] appears to have started a thread named [New I/O server boss #1 ([id: 0x1a70dc46, /0:0:0:0:0:0:0:0:20881])] but has failed to stop it. This is very likely to create a memory leak.
二月 25, 2022 11:20:16 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [] appears to have started a thread named [dubbo-remoting-server-heartbeat-thread-1] but has failed to stop it. This is very likely to create a memory leak.
二月 25, 2022 11:20:16 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [] appears to have started a thread named [DubboRegistryFailedRetryTimer-thread-1] but has failed to stop it. This is very likely to create a memory leak.
二月 25, 2022 11:20:16 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [] appears to have started a thread named [DubboZkclientConnector] but has failed to stop it. This is very likely to create a memory leak.
二月 25, 2022 11:20:16 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [] appears to have started a thread named [ZkClient-EventThread-22-139.224.55.130:9090] but has failed to stop it. This is very likely to create a memory leak.
二月 25, 2022 11:20:16 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [] appears to have started a thread named [DubboZkclientConnector-SendThread(139.224.55.130:9090)] but has failed to stop it. This is very likely to create a memory leak.
二月 25, 2022 11:20:16 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [] appears to have started a thread named [DubboZkclientConnector-EventThread] but has failed to stop it. This is very likely to create a memory leak.
二月 25, 2022 11:20:16 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
严重: The web application [] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@25545dff]) and a value of type [java.lang.Class] (value [class com.nxg.service.impl.HelloServiceImpl]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
二月 25, 2022 11:20:16 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8082"]
本文来自博客园,作者:所遇所思,转载请注明原文链接:https://www.cnblogs.com/mynxg/p/17989338
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
2021-02-25 算法