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&timestamp=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&timestamp=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&timestamp=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&timestamp=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&timestamp=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&timestamp=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&timestamp=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&timestamp=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"]

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

所遇所思

你的鼓励将是我的原动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值