DUBBO demo 启动一直会自动 shutdown

我把 demo 的工程上传到了 git 上,demo 工程很简单。
我查阅了 dubbo 的官方 wiki,对照一步步的做过,还是不行。
图片说明

这是项目的 git 地址:git@git.oschna.net:alpha4/dubbo-sample.git

图片说明

4个回答

因为zookeeper没有起来导致的问题,所以遇到此类问题可以先检查 20880端口。然后看下两边注册中心的地址是否一致。

我也遇到这个问题了,不知楼主解决了没有?

你好,我是看了你一篇很早以前关于短信的帖子过来的,我也碰到了SecurityException: Sending SMS message: uid 10085 does not have android.permission.SEND_SMS 的问题,当时你已经解决了,能帮我解决一下吗,试了很多方法,静态动态注册包括root,不知道哪里出了问题。可以的话加一下q:1054007211,或者回复给我发一下你当时的demo可以吗。万分感谢。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
springmvc+dubbo 启动过程几点问题,求解答
springmvc中引入dubbo的配置文件后,在启动web容器的时候会加载dubbo的配置文件 并由dubbo的解释器进行解析xml配置,装配到spring容器,问题来了,问题1:我并没有启动dubbo的服务,dubbo是怎么启动的?问题2:dubbo的启动是通过com.alibaba.dubbo.container.Main中的main方法启动的,源码中是在main方法中又启动了一个SpringContainer,这里的Main是谁来调用的?问题3:以上过程中是不是启动了两spring容器?
往虚拟机上装一个dubbo服务,启动的时候一直停在Starting the localhost.localdomain...
如题... 往虚拟机上装一个dubbo服务 启动的时候一直停在Starting the localhost.localdomain... 使用eclispse maven assembly打包的 在windows上能正常运行 放到虚拟机上就不行了 ![图片说明](https://img-ask.csdn.net/upload/201909/10/1568112580_468194.png)
springboot整合dubbo服务启动报错
SpringBoot1.5.1,Dubbo 2..8.4,JDK 1.8.0_171 zookeeper确定是启动的。 provider配置如下: ``` <!--定义了提供方应用信息,用于计算依赖关系;在 dubbo-admin 或 dubbo-monitor 会显示这个名字,方便辨识--> <dubbo:application name="demotest-provider" owner="programmer" organization="dubbox"/> <!--使用 zookeeper 注册中心暴露服务,注意要先开启 zookeeper--> <dubbo:registry address="zookeeper://localhost:2181"/> <!-- 用dubbo协议在20880端口暴露服务 --> <dubbo:protocol name="dubbo" port="20880" /> <!--使用 dubbo 协议实现定义好的接口--> <dubbo:service interface="cn.kaison.xblog.system.api.service.SystemService" ref="systemService" protocol="dubbo"></dubbo:service> <!--具体实现该接口的 bean--> <bean id="demoService" class="cn.kaison.xblog.system.provider.serviceImpl.SystemServiceImpl"></bean> ``` 项目结构: ![图片说明](https://img-ask.csdn.net/upload/201804/20/1524156832_387407.png) 启动后报错如下: 2018-04-20 00:43:04.775 WARN 18261 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.kaison.xblog.system.api.service.SystemService': Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError 2018-04-20 00:43:04.779 WARN 18261 --- [ main] o.s.boot.SpringApplication : Error handling failed (Error creating bean with name 'cn.kaison.xblog.system.api.service.SystemService': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.dubbo.config.spring.ServiceBean) 2018-04-20 00:43:04.789 ERROR 18261 --- [ main] o.s.boot.SpringApplication : Application startup failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.kaison.xblog.system.api.service.SystemService': Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1155) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE] at cn.kaison.xblog.system.provider.SysProviderApplication.main(SysProviderApplication.java:30) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na] Caused by: java.lang.ExceptionInInitializerError: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_144] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_144] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_144] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_144] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1147) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] ... 20 common frames omitted Caused by: java.lang.IllegalStateException: fail to create adaptive instance: java.lang.IllegalStateException: Can not create adaptive extenstion interface com.alibaba.dubbo.rpc.Protocol, cause: Failed to load extension class(interface: interface com.alibaba.dubbo.common.compiler.Compiler, class line: com.alibaba.dubbo.common.compiler.support.JavassistCompiler) in jar:file:/Users/xiaohuchen/Documents/_my_soft/mavenrepo/com/alibaba/dubbo/2.8.4/dubbo-2.8.4.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.common.compiler.Compiler, cause: javassist/ClassPath at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:459) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.config.ServiceConfig.<clinit>(ServiceConfig.java:62) ~[dubbo-2.8.4.jar:2.8.4] ... 27 common frames omitted Caused by: java.lang.IllegalStateException: Can not create adaptive extenstion interface com.alibaba.dubbo.rpc.Protocol, cause: Failed to load extension class(interface: interface com.alibaba.dubbo.common.compiler.Compiler, class line: com.alibaba.dubbo.common.compiler.support.JavassistCompiler) in jar:file:/Users/xiaohuchen/Documents/_my_soft/mavenrepo/com/alibaba/dubbo/2.8.4/dubbo-2.8.4.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.common.compiler.Compiler, cause: javassist/ClassPath at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:723) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:455) ~[dubbo-2.8.4.jar:2.8.4] ... 28 common frames omitted Caused by: java.lang.IllegalStateException: Failed to load extension class(interface: interface com.alibaba.dubbo.common.compiler.Compiler, class line: com.alibaba.dubbo.common.compiler.support.JavassistCompiler) in jar:file:/Users/xiaohuchen/Documents/_my_soft/mavenrepo/com/alibaba/dubbo/2.8.4/dubbo-2.8.4.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.common.compiler.Compiler, cause: javassist/ClassPath at com.alibaba.dubbo.common.extension.ExtensionLoader.loadFile(ExtensionLoader.java:685) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.loadExtensionClasses(ExtensionLoader.java:591) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getExtensionClasses(ExtensionLoader.java:567) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:728) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:721) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:455) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClass(ExtensionLoader.java:738) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:732) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:721) ~[dubbo-2.8.4.jar:2.8.4] ... 29 common frames omitted Caused by: java.lang.NoClassDefFoundError: javassist/ClassPath at java.lang.Class.forName0(Native Method) ~[na:1.8.0_144] at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_144] at com.alibaba.dubbo.common.extension.ExtensionLoader.loadFile(ExtensionLoader.java:627) ~[dubbo-2.8.4.jar:2.8.4] ... 37 common frames omitted Caused by: java.lang.ClassNotFoundException: javassist.ClassPath at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_144] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_144] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_144] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_144] ... 40 common frames omitted
dubbo发布服务失败的问题
编写了一个dubbo-demo的maven项目, 运行Provider类出现如下错误: Exception in thread "main" java.lang.IllegalStateException: Failed to register dubbo://169.254.165.91:20880/com.ruyi.dubbo.demo.DemoService?anyhost=true&application=dubbo-demo-provider&dubbo=2.6.2&generic=false&interface=com.ruyi.dubbo.demo.DemoService&methods=sayHello&pid=14868&side=provider&timestamp=1528802622329 to registry 127.0.0.1:2181, cause: Failed to register dubbo://169.254.165.91:20880/com.ruyi.dubbo.demo.DemoService?anyhost=true&application=dubbo-demo-provider&dubbo=2.6.2&generic=false&interface=com.ruyi.dubbo.demo.DemoService&methods=sayHello&pid=14868&side=provider&timestamp=1528802622329 to zookeeper zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbo-demo-provider&dubbo=2.6.2&interface=com.alibaba.dubbo.registry.RegistryService&pid=14868&qos.port=22222&timestamp=1528802622317, cause: KeeperErrorCode = ConnectionLoss at com.alibaba.dubbo.registry.support.FailbackRegistry.register(FailbackRegistry.java:144) at com.alibaba.dubbo.registry.integration.RegistryProtocol.register(RegistryProtocol.java:125) at com.alibaba.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:145) at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:54) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:98) at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:55) at com.alibaba.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:506) at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:358) at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:317) at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:216) at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:123) at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:49) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93) at com.ruyi.dubbo.demo.provider.Provider.main(Provider.java:19) Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to register dubbo://169.254.165.91:20880/com.ruyi.dubbo.demo.DemoService?anyhost=true&application=dubbo-demo-provider&dubbo=2.6.2&generic=false&interface=com.ruyi.dubbo.demo.DemoService&methods=sayHello&pid=14868&side=provider&timestamp=1528802622329 to zookeeper zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbo-demo-provider&dubbo=2.6.2&interface=com.alibaba.dubbo.registry.RegistryService&pid=14868&qos.port=22222&timestamp=1528802622317, cause: KeeperErrorCode = ConnectionLoss at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:116) at com.alibaba.dubbo.registry.support.FailbackRegistry.register(FailbackRegistry.java:131) ... 21 more Caused by: java.lang.IllegalStateException: KeeperErrorCode = ConnectionLoss at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createPersistent(CuratorZookeeperClient.java:79) at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:65) at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:59) at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:59) at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:59) at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:114) ... 22 more Caused by: org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss at org.apache.curator.ConnectionState.checkTimeouts(ConnectionState.java:225) at org.apache.curator.ConnectionState.getZooKeeper(ConnectionState.java:94) at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:117) at org.apache.curator.framework.imps.CuratorFrameworkImpl.getZooKeeper(CuratorFrameworkImpl.java:489) at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:740) at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:723) at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:109) at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:720) at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:484) at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:474) at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:454) at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44) at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createPersistent(CuratorZookeeperClient.java:76) ... 27 more 项目结构为: dubbo-demo - dubbo-demo-api - com.ruyi.dubbo.demo.DemoService.java - dubbo-demo-provider - com.ruyi.dubbo.demo.provider.DemoServiceImpl - com.ruyi.dubbo.demo.provider.Provider - META-INF/spring/dubbo-demo-provider.xml - dubbo-demo-consumer dubbo-demo-api包含一个DemoService接口: public interface DemoService { String sayHello(String name); } dubbo-demo-provider包含一个类实现DemoService接口的DemoServiceImpl类: public class DemoServiceImpl implements DemoService { @Override public String sayHello(String name) { // TODO Auto-generated method stub return "Hello " + name; } } 以及一个Provider类: public class Provider { public static void main(String[] args) throws Exception { //Prevent to get IPV6 address,this way only work in debug mode //But you can pass use -Djava.net.preferIPv4Stack=true,then it work well whether in debug mode or not System.setProperty("java.net.preferIPv4Stack", "true"); ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"META-INF/spring/dubbo-demo-provider.xml"}); context.start(); System.in.read(); // press any key to exit } } dubbo-demo-provider.xml: <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://dubbo.apache.org/schema/dubbo" xmlns="http://www.springframework.org/schema/beans" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd"> <!-- provider's application name, used for tracing dependency relationship --> <dubbo:application name="dubbo-demo-provider"/> <!-- use multicast registry center to export service --> <!-- <dubbo:registry address="multicast://224.5.6.7:1234"/> --> <dubbo:registry address="zookeeper://127.0.0.1:2181"/> <!-- use dubbo protocol to export service on port 20880 --> <dubbo:protocol name="dubbo" port="20880"/> <!-- service implementation, as same as regular local bean --> <bean id="demoService" class="com.ruyi.dubbo.demo.provider.DemoServiceImpl"/> <!-- declare the service interface to be exported --> <dubbo:service interface="com.ruyi.dubbo.demo.DemoService" ref="demoService"/> </beans> dubbo-demo-consumer项目(略)
DUBBO启动报错找不到服务
ERROR 10:16:41,178 AbstractClient:<init> - [DUBBO] Failed to start NettyClient caedmon-PC/192.168.0.234 connect to the server /60.191.124.236:21890 (check == false, ignore and retry later!), cause: client(url: dubbo://60.191.124.236:21890/com.sendinfo.ebiz3.account.server.UserServer?anyhost=true&application=wuzhen-b2c-provider&check=false&codec=dubbo&default.check=false&default.retries=0&default.timeout=20000&dubbo=2.5.3&heartbeat=60000&interface=com.sendinfo.ebiz3.account.server.UserServer&methods=queryConsumerPointVo,updateAccount,queryConsumer,updateLogin,loginOut,getLogin,regConsumer,getAccount,queryLogin,updateConsumer&pid=6212&side=consumer&timeout=5000&timestamp=1425544252633) failed to connect to server /60.191.124.236:21890 client-side timeout 3000ms (elapsed: 3003ms) from netty client 192.168.0.234 using dubbo version 2.5.3, dubbo version: 2.5.3, current host: 192.168.0.234 com.alibaba.dubbo.remoting.RemotingException: client(url: dubbo://60.191.124.236:21890/com.sendinfo.ebiz3.account.server.UserServer?anyhost=true&application=wuzhen-b2c-provider&check=false&codec=dubbo&default.check=false&default.retries=0&default.timeout=20000&dubbo=2.5.3&heartbeat=60000&interface=com.sendinfo.ebiz3.account.server.UserServer&methods=queryConsumerPointVo,updateAccount,queryConsumer,updateLogin,loginOut,getLogin,regConsumer,getAccount,queryLogin,updateConsumer&pid=6212&side=consumer&timeout=5000&timestamp=1425544252633) failed to connect to server /60.191.124.236:21890 client-side timeout 3000ms (elapsed: 3003ms) from netty client 192.168.0.234 using dubbo version 2.5.3 at com.alibaba.dubbo.remoting.transport.netty.NettyClient.doConnect(NettyClient.java:127) at com.alibaba.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:280) at com.alibaba.dubbo.remoting.transport.AbstractClient.<init>(AbstractClient.java:103) at com.alibaba.dubbo.remoting.transport.netty.NettyClient.<init>(NettyClient.java:61) at com.alibaba.dubbo.remoting.transport.netty.NettyTransporter.connect(NettyTransporter.java:37) at com.alibaba.dubbo.remoting.Transporter$Adpative.connect(Transporter$Adpative.java) at com.alibaba.dubbo.remoting.Transporters.connect(Transporters.java:67) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchanger.connect(HeaderExchanger.java:37) at com.alibaba.dubbo.remoting.exchange.Exchangers.connect(Exchangers.java:102) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.initClient(DubboProtocol.java:378) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.getSharedClient(DubboProtocol.java:344) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.getClients(DubboProtocol.java:321) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.refer(DubboProtocol.java:303) at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:65) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:62) at com.alibaba.dubbo.rpc.Protocol$Adpative.refer(Protocol$Adpative.java) at com.alibaba.dubbo.registry.integration.RegistryDirectory.toInvokers(RegistryDirectory.java:395) at com.alibaba.dubbo.registry.integration.RegistryDirectory.refreshInvoker(RegistryDirectory.java:224) at com.alibaba.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:195) at com.alibaba.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:449) at com.alibaba.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:273) at com.alibaba.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:259) at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.access$400(ZookeeperRegistry.java:45) at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry$3.childChanged(ZookeeperRegistry.java:159) at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient$2.handleChildChange(ZkclientZookeeperClient.java:82) at org.I0Itec.zkclient.ZkClient$8.run(ZkClient.java:583) at org.I0Itec.zkclient.ZkEventThread.run(ZkEventThread.java:71)
配置dubbo,启动消费端服务器出现这个问题
严重: 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 'demoPurchaseController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.saic.ndms.base.api.DemoPurchaseService com.saic.ndms.base.web.controller.DemoPurchaseController.demoPurchaseService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoPurchaseService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.saic.ndms.base.api.DemoPurchaseService. No provider available for the service com.saic.ndms.base.api.DemoPurchaseService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=ndms-base-server&dubbo=2.8.4-cep1.0&interface=com.saic.ndms.base.api.DemoPurchaseService&methods=countByExample,getAllDemoPurchase&pid=8972&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1511919329139 to the consumer 10.31.195.65 use dubbo version 2.8.4-cep1.0 at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5077) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5591) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564) at java.util.concurrent.FutureTask.run(FutureTask.java:262) 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) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.saic.ndms.base.api.DemoPurchaseService com.saic.ndms.base.web.controller.DemoPurchaseController.demoPurchaseService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoPurchaseService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.saic.ndms.base.api.DemoPurchaseService. No provider available for the service com.saic.ndms.base.api.DemoPurchaseService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=ndms-base-server&dubbo=2.8.4-cep1.0&interface=com.saic.ndms.base.api.DemoPurchaseService&methods=countByExample,getAllDemoPurchase&pid=8972&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1511919329139 to the consumer 10.31.195.65 use dubbo version 2.8.4-cep1.0 at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ... 22 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoPurchaseService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.saic.ndms.base.api.DemoPurchaseService. No provider available for the service com.saic.ndms.base.api.DemoPurchaseService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=ndms-base-server&dubbo=2.8.4-cep1.0&interface=com.saic.ndms.base.api.DemoPurchaseService&methods=countByExample,getAllDemoPurchase&pid=8972&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1511919329139 to the consumer 10.31.195.65 use dubbo version 2.8.4-cep1.0 at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533) ... 24 more Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.saic.ndms.base.api.DemoPurchaseService. No provider available for the service com.saic.ndms.base.api.DemoPurchaseService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=ndms-base-server&dubbo=2.8.4-cep1.0&interface=com.saic.ndms.base.api.DemoPurchaseService&methods=countByExample,getAllDemoPurchase&pid=8972&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1511919329139 to the consumer 10.31.195.65 use dubbo version 2.8.4-cep1.0 at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:420) at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:300) at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:138) at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:65) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) ... 32 more
zookeeper+dubbo+tomcat启动tomcat失败
1、启动时显示的日志 INFO logger.LoggerFactory - using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter ERROR common.Version - [DUBBO] Duplicate class com/alibaba/dubbo/common/Version.class in 2 jar [file:/data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/webapps/dubbo-admin-2.8.3/WEB-INF/lib/dubbo-2.8.3.jar!/com/alibaba/dubbo/common/Version.class, file:/data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/webapps/dubbo-admin-2.8.3/WEB-INF/lib/dubbo-common-2.8.3.jar!/com/alibaba/dubbo/common/Version.class], dubbo version: 2.8.3, current host: 127.0.0.1 ERROR common.Version - [DUBBO] Duplicate class com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class in 2 jar [file:/data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/webapps/dubbo-admin-2.8.3/WEB-INF/lib/dubbo-2.8.3.jar!/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class, file:/data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/webapps/dubbo-admin-2.8.3/WEB-INF/lib/dubbo-config-spring-2.8.3.jar!/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class], dubbo version: 2.8.3, current host: 127.0.0.1 INFO config.PropertyPlaceholderConfigurer - Loading properties file from Resource[/WEB-INF/dubbo.properties, loaded by ResourceLoadingService] INFO config.PropertyPlaceholderConfigurer - Loading properties file from URL [file:/home/rdc/dubbo.properties] WARN config.PropertyPlaceholderConfigurer - Could not load properties from URL [file:/home/rdc/dubbo.properties]: /home/rdc/dubbo.properties (No such file or directory) INFO config.WebxConfiguration - Application is running in Production Mode. INFO upload.UploadService - Upload Parameters: { Repository Path = /data/rdc/rdc/tools/normal-app/apache-tomcat-7.0.32/temp Maximum Request Size = 5M Maximum File Size = n/a Threshold before Writing to File = 10K Keep Form Field in Memory = false File Name Key = [ [1/1] filename ] } INFO context.WebxComponentsContext - Bean '(inner bean)#28fca922' of type [class com.alibaba.citrus.springext.util.SpringExtUtil$ConstructorArg] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.WebxComponentsContext - Bean 'dubbo-admin' of type [class com.alibaba.dubbo.config.ApplicationConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.WebxComponentsContext - Bean 'com.alibaba.dubbo.config.RegistryConfig' of type [class com.alibaba.dubbo.config.RegistryConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.WebxComponentsContext - Bean 'registryService' of type [class com.alibaba.dubbo.config.spring.ReferenceBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.WebxComponentsContext - Bean '(inner bean)#28fca922' of type [class com.alibaba.citrus.webx.config.impl.WebxConfigurationImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) INFO context.InheritableListableBeanFactory - Pre-instantiating singletons in com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@7eb88bc8: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,com.alibaba.citrus.service.configuration.support.PropertyPlaceholderConfigurer#0,templateService,mappingRuleService,dataResolverService,exceptionPipeline,resourceLoadingService,messageSource,uriBrokerService,restfulRewrite,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dubbo-admin,com.alibaba.dubbo.config.RegistryConfig,registryService,configService,consumerService,overrideService,ownerService,providerService,routeService,userService,governanceCache,productionModeSensiblePostProcessor,webxConfiguration,requestContexts,com.alibaba.citrus.service.requestcontext.impl.RequestContextBeanFactoryPostProcessor#0,uploadService,pullService,formService,module.screen.Error404,module.screen.ErrorOther,moduleLoaderService,messageResourceService,com.alibaba.citrus.webx.context.WebxComponentsLoader$WebxComponentsCreator,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting. INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/common/' INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete. INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled INFO zkclient.ZkEventThread - Starting ZkClient event thread. 请问这是什么情况?大神。。。。。
dubbo服务发布时自动注解失败
在做dubbo发布服务时,我用的注解是spring框架的自动注解(非dubbo的),然后启动 服务时,在dubbo的监测中心表示该服务没有提供者,在控制台则提示自动注解失败
dubbo启动报错连接服务超时
dubbo启动会检查所有提供者,有的能调通,有的由于服务器设置不能调通。怎样设置只要有能调通的就不报错,而不是遇到调不通的就报错。求各位大神解答。。。。。。。。。。
启动tomcat 报dubbo端口号冲突
启动tomcat ,同时会报下面的错误 14:56:08.607 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader - Context initialization failed com.alibaba.dubbo.rpc.RpcException: Fail to start server(url: dubbo://172.16.0.62:21889/com.winit.sms.spi.base.customeracct.CustomerAcctService?anyhost=true&application=sms&channel.readonly.sent=true&codec=dubbo&default.cluster=failover&default.executes=500&default.loadbalance=random&default.retries=0&default.service.filter=dubboProviderFilter&default.timeout=60000&default.validation=true&dispatcher=all&dubbo=2.8.3&dynamic=true&generic=false&heartbeat=60000&interface=com.winit.sms.spi.base.customeracct.CustomerAcctService&methods=queryCustomerAcctById,queryCustomerAcctByBpartnerCode,createCustomerAcct,pageCustomerAcct,modifyCustomerAcct&organization=winit&owner=liuyan.chen&pid=14588&revision=1.21.6.NewWorldPhase2.SNAPSHOT&side=provider&threadpool=limited&threads=300&timestamp=1453791368562&version=5.0.0) Failed to bind NettyServer on /172.16.0.62:21889, cause: Failed to bind to: /0.0.0.0:21889 at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:331) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.openServer(DubboProtocol.java:308) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.export(DubboProtocol.java:258) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:55) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:56) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.rpc.Protocol$Adpative.export(Protocol$Adpative.java) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:153) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:107) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:53) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:54) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.rpc.Protocol$Adpative.export(Protocol$Adpative.java) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:489) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:285) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:246) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:145) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:109) ~[dubbo-2.8.3.jar:2.8.3] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96) ~[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) ~[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948) ~[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) ~[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410) ~[spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) ~[spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003) [catalina.jar:7.0.65] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517) [catalina.jar:7.0.65] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.65] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.65] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.65] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [catalina.jar:7.0.65] at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263) [catalina.jar:7.0.65] at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1978) [catalina.jar:7.0.65] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_80] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_80] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_80] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_80] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80] Caused by: com.alibaba.dubbo.remoting.RemotingException: Failed to bind NettyServer on /172.16.0.62:21889, cause: Failed to bind to: /0.0.0.0:21889 at com.alibaba.dubbo.remoting.transport.AbstractServer.<init>(AbstractServer.java:72) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.remoting.transport.netty.NettyServer.<init>(NettyServer.java:63) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.remoting.transport.netty.NettyTransporter.bind(NettyTransporter.java:33) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.remoting.Transporter$Adpative.bind(Transporter$Adpative.java) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.remoting.Transporters.bind(Transporters.java:48) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchanger.bind(HeaderExchanger.java:41) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.remoting.exchange.Exchangers.bind(Exchangers.java:63) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:329) ~[dubbo-2.8.3.jar:2.8.3] ... 35 common frames omitted Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:21889 at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:303) ~[netty-3.2.5.Final.jar:na] at com.alibaba.dubbo.remoting.transport.netty.NettyServer.doOpen(NettyServer.java:94) ~[dubbo-2.8.3.jar:2.8.3] at com.alibaba.dubbo.remoting.transport.AbstractServer.<init>(AbstractServer.java:67) ~[dubbo-2.8.3.jar:2.8.3] ... 42 common frames omitted Caused by: java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) ~[na:1.7.0_80] at sun.nio.ch.Net.bind(Net.java:463) ~[na:1.7.0_80] at sun.nio.ch.Net.bind(Net.java:455) ~[na:1.7.0_80] at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.7.0_80] at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.7.0_80] at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.bind(NioServerSocketPipelineSink.java:148) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleServerSocket(NioServerSocketPipelineSink.java:100) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:74) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.Channels.bind(Channels.java:468) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.AbstractChannel.bind(AbstractChannel.java:192) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.bootstrap.ServerBootstrap$Binder.channelOpen(ServerBootstrap.java:348) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.Channels.fireChannelOpen(Channels.java:176) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:85) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:142) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.newChannel(NioServerSocketChannelFactory.java:90) ~[netty-3.2.5.Final.jar:na] at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:282) ~[netty-3.2.5.Final.jar:na] ... 44 common frames omitted
Dubbo启动时报错,找不到 NetUtils
Illegal access: this web application instance has been stopped already. Could not load com.alibaba.dubbo.common.utils.NetUtils. 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 com.alibaba.dubbo.common.logger.support.FailsafeLogger.appendContextMessage(FailsafeLogger.java:39) at com.alibaba.dubbo.common.logger.support.FailsafeLogger.warn(FailsafeLogger.java:107) at com.alibaba.dubbo.config.ReferenceConfig$1.finalize(ReferenceConfig.java:106) at java.lang.System$2.invokeFinalize(System.java:1270) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98) at java.lang.ref.Finalizer.access$100(Finalizer.java:34) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)
项目启动 dubbo zookeeper 问题
启动项目后 控制台打印这些 不知道什么地方有问题 }, dubbo version: 2.5.3, current host: 192.168.21.25 2017-12-19 17:00:47,133 [localhost-startStop-1] INFO [com.alibaba.dubbo.remoting.transport.AbstractClient] - [DUBBO] Successed connect to server /192.168.21.25:20880 from NettyClient 192.168.21.25 using dubbo version 2.5.3, channel is NettyChannel [channel=[id: 0x2cd65ccc, /192.168.21.25:61997 => /192.168.21.25:20880]], dubbo version: 2.5.3, current host: 192.168.21.25 2017-12-19 17:00:47,133 [localhost-startStop-1] INFO [com.alibaba.dubbo.remoting.transport.AbstractClient] - [DUBBO] Start NettyClient DESKTOP-MAN0K4J/192.168.21.25 connect to the server /192.168.21.25:20880, dubbo version: 2.5.3, current host: 192.168.21.25 2017-12-19 17:00:47,154 [localhost-startStop-1] DEBUG [com.alibaba.dubbo.common.extension.ExtensionLoader] - [DUBBO] package com.alibaba.dubbo.validation; import com.alibaba.dubbo.common.extension.ExtensionLoader; public class Validation$Adpative implements com.alibaba.dubbo.validation.Validation { public com.alibaba.dubbo.validation.Validator getValidator(com.alibaba.dubbo.common.URL arg0) { if (arg0 == null) throw new IllegalArgumentException("url == null"); com.alibaba.dubbo.common.URL url = arg0; String extName = url.getParameter("validation", "jvalidation"); if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.validation.Validation) name from url(" + url.toString() + ") use keys([validation])"); com.alibaba.dubbo.validation.Validation extension = (com.alibaba.dubbo.validation.Validation)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.validation.Validation.class).getExtension(extName); return extension.getValidator(arg0); } }, dubbo version: 2.5.3, current host: 192.168.21.25 2017-12-19 17:00:47,161 [localhost-startStop-1] DEBUG [com.alibaba.dubbo.common.extension.ExtensionLoader] - [DUBBO] package com.alibaba.dubbo.monitor; import com.alibaba.dubbo.common.extension.ExtensionLoader; public class MonitorFactory$Adpative implements com.alibaba.dubbo.monitor.MonitorFactory { public com.alibaba.dubbo.monitor.Monitor getMonitor(com.alibaba.dubbo.common.URL arg0) { if (arg0 == null) throw new IllegalArgumentException("url == null"); com.alibaba.dubbo.common.URL url = arg0; String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() ); if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.monitor.MonitorFactory) name from url(" + url.toString() + ") use keys([protocol])"); com.alibaba.dubbo.monitor.MonitorFactory extension = (com.alibaba.dubbo.monitor.MonitorFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.monitor.MonitorFactory.class).getExtension(extName); return extension.getMonitor(arg0); } }, dubbo version: 2.5.3, current host: 192.168.21.25 2017-12-19 17:00:47,170 [localhost-startStop-1] DEBUG [com.alibaba.dubbo.common.extension.ExtensionLoader] - [DUBBO] package com.alibaba.dubbo.cache; import com.alibaba.dubbo.common.extension.ExtensionLoader; public class CacheFactory$Adpative implements com.alibaba.dubbo.cache.CacheFactory { public com.alibaba.dubbo.cache.Cache getCache(com.alibaba.dubbo.common.URL arg0) { if (arg0 == null) throw new IllegalArgumentException("url == null"); com.alibaba.dubbo.common.URL url = arg0; String extName = url.getParameter("cache", "lru"); if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.cache.CacheFactory) name from url(" + url.toString() + ") use keys([cache])"); com.alibaba.dubbo.cache.CacheFactory extension = (com.alibaba.dubbo.cache.CacheFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.cache.CacheFactory.class).getExtension(extName); return extension.getCache(arg0); } }, dubbo version: 2.5.3, current host: 192.168.21.25 2017-12-19 17:00:47,181 [localhost-startStop-1] INFO [com.alibaba.dubbo.config.AbstractConfig] - [DUBBO] Refer dubbo service com.taotao.service.ItemService from url zookeeper://192.168.21.25:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=taotao-manager-web&check=false&dubbo=2.5.3&interface=com.taotao.service.ItemService&methods=getItemById&pid=16920&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=151 2017-12-19 17:00:47,186 [localhost-startStop-1] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor' 2017-12-19 17:00:47,186 [localhost-startStop-1] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'org.springframework.context.event.internalEventListenerProcessor' 2017-12-19 17:00:47,252 [localhost-startStop-1] DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment] 2017-12-19 17:00:47,252 [localhost-startStop-1] DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null] 2017-12-19 17:00:47,253 [localhost-startStop-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Published WebApplicationContext of servlet 'taotao-manager-web' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.taotao-manager-web] 2017-12-19 17:00:47,253 [localhost-startStop-1] INFO [org.springframework.web.servlet.DispatcherServlet] - FrameworkServlet 'taotao-manager-web': initialization completed in 2097 ms * 2017-12-19 17:00:47,253 [localhost-startStop-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Servlet 'taotao-manager-web' configured successfully
dubbo消费方调用不到服务方问题
消费方 配置 和代码: web.xml ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance " xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <servlet> <!-- 配置servlet --> <servlet-name>HelloWeb</servlet-name> <!-- 可以理解为刚给当前servlet起名字,可自定义 --> <!-- springmvc的核心处理器,不可自定义 --> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <!-- 配置Spring mvc下的配置文件的位置和名称 --> <init-param> <!-- 核心处理器的初始化,不可自定义 --> <param-name>contextConfigLocation</param-name> <param-value>classpath:Spring-mvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <!-- 可以理解为指定被Mapping的servlet的名称(代码第二行中的名称相同) --> <servlet-name>HelloWeb</servlet-name> <!-- 配置拦截路径,/表示全拦截 --> <url-pattern>*.action</url-pattern> </servlet-mapping> </web-app> ``` ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo = "http://code.alibabatech.com/schema/dubbo" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> <context:annotation-config/> <!-- bean definitions go here--> <!-- 配置dubbo的应用名称 --> <dubbo:application name="student_consumer"></dubbo:application> <!-- 配置dubbo的配置中心 <dubbo:registry protocol="zookeeper" address="zookeeper://122.51.144.197:2181" ></dubbo:registry>--> <dubbo:registry protocol="zookeeper" address="zookeeper://192.168.234.118:2181" ></dubbo:registry> <!-- 配置dubbo的扫描包 将@service注解的类放入dubbo扫描包,供dubbo远程调用(RPC)时使用--> <dubbo:annotation package="org.controller"></dubbo:annotation> <!-- 注入到spring的 ioc容器中 --> <context:component-scan base-package="org.controller"></context:component-scan> ``` ----------------------------------------------------代码 ![图片说明](https://img-ask.csdn.net/upload/201912/21/1576939071_98741.jpg) 提供方 配置 ![图片说明](https://img-ask.csdn.net/upload/201912/21/1576939144_800881.jpg) 代码: ``` package com.test.impl; import com.alibaba.dubbo.config.annotation.Service; import com.test.api.StudentServer; @Service //alibaba public class StudentServerImpl implements StudentServer{ public String server(String name) { String hello="你好,很高心遇见你!"; return hello; } } ``` 报错信息: Servlet.service() for servlet [HelloWeb] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause java.lang.NullPointerException at org.controller.StudentController.rpcServer(StudentController.java:17) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) ![图片说明](https://img-ask.csdn.net/upload/201912/21/1576939448_968772.png)
dubbo-admin启动时连接zookeeper失败
在Tomcat8.5发布dubbo-admin出现以下错误: 即dubbo-admin没有连上zookeeper. ``` ERROR curator.ConnectionState - Connection timed out for connection string (127.0.0.1:2181) and timeout (5000) / elapshttps://ask.csdn.net/questions/691453#ed (19803) org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss at org.apache.curator.ConnectionState.checkTimeouts(ConnectionState.java:225) at org.apache.curator.ConnectionState.getZooKeeper(ConnectionState.java:94) at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:117) at org.apache.curator.framework.imps.CuratorFrameworkImpl.getZooKeeper(CuratorFrameworkImpl.java:489) at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:740) at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:723) at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:109) at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:720) at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:484) at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:474) at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:454) at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44) at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient.createPersistent(CuratorZookeeperClient.java:74) at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:63) at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doSubscribe(ZookeeperRegistry.java:149) at com.alibaba.dubbo.registry.support.FailbackRegistry.retry(FailbackRegistry.java:377) at com.alibaba.dubbo.registry.support.FailbackRegistry$1.run(FailbackRegistry.java:70) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) ``` 备注: 1.dubbo-admin的github下载地址为:https://github.com/apache/incubator-dubbo-ops dubbo.properties配置文件内容为(未做修改过) dubbo.registry.address=zookeeper://127.0.0.1:2181 dubbo.admin.root.password=root dubbo.admin.guest.password=guest 2.dubbo-admin已正常启动,可正常访问http://localhost:8080/dubbo-admin-2.0.0/ 3.zookeeper的版本的3.4.8, 4.操作系统为win10 5.验证zookeeper启动结果为: 查看端口占用情况: C:\WINDOWS\system32>netstat -ano|findstr "2181" TCP 0.0.0.0:2181 0.0.0.0:0 LISTENING 13908 TCP 127.0.0.1:2181 127.0.0.1:9049 CLOSE_WAIT 13908 TCP 127.0.0.1:2181 127.0.0.1:9062 CLOSE_WAIT 13908 TCP 127.0.0.1:2181 127.0.0.1:9082 ESTABLISHED 13908 TCP 127.0.0.1:9049 127.0.0.1:2181 FIN_WAIT_2 8340 TCP 127.0.0.1:9062 127.0.0.1:2181 FIN_WAIT_2 8340 TCP 127.0.0.1:9082 127.0.0.1:2181 ESTABLISHED 8340 TCP [::]:2181 [::]:0 LISTENING 13908 使用jps查看java进程情况: C:\WINDOWS\system32>jps 13908 QuorumPeerMain 8340 Bootstrap 12376 Jps 8696 org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar 使用zookeeper客户端测试连接情况: E:\zookeeper-3.4.8\bin>zkCli.cmd -server 127.0.0.1:2181 Connecting to 127.0.0.1:2181 2018-06-07 23:49:57,276 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.8--1, built on 02/06/2016 03:18 GMT .... Welcome to ZooKeeper! 2018-06-07 23:49:57,598 [myid:] - INFO [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) 2018-06-07 23:49:57,600 [myid:] - INFO [main-SendThread(127.0.0.1:2181):ClientCnxn$SendThread@876] - Socket connection established to 127.0.0.1/127.0.0.1:2181, initiating session JLine support is enabled [zk: 127.0.0.1:2181(CONNECTING) 0]
dubbo客户端启动时连接不上服务端
项目一启动就报这个错误 服务也开着 ``` 2017-08-23 15:42:40 [com.alibaba.dubbo.remoting.transport.AbstractClient]-[160]-[WARN] [DUBBO] client reconnect to 172.19.34.180:20880 find error . url: dubbo://172.19.34.180:20880/com.onionapi.service.AService?accepts=50000&anyhost=true&application=onionweb&check=false&codec=dubbo&default.check=false&default.retries=0&default.timeout=2000000&dubbo=2.5.3&heartbeat=60000&interface=com.onionapi.service.AService&methods=getAbc&pid=1504&revision=1.0-SNAPSHOT&side=consumer&timestamp=1503474154020, dubbo version: 2.5.3, current host: 192.168.1.23 com.alibaba.dubbo.remoting.RemotingException: client(url: dubbo://172.19.34.180:20880/com.onionapi.service.AService?accepts=50000&anyhost=true&application=onionweb&check=false&codec=dubbo&default.check=false&default.retries=0&default.timeout=2000000&dubbo=2.5.3&heartbeat=60000&interface=com.onionapi.service.AService&methods=getAbc&pid=1504&revision=1.0-SNAPSHOT&side=consumer&timestamp=1503474154020) failed to connect to server /172.19.34.180:20880 client-side timeout 3000ms (elapsed: 3001ms) from netty client 192.168.1.23 using dubbo version 2.5.3 at com.alibaba.dubbo.remoting.transport.netty.NettyClient.doConnect(NettyClient.java:127) at com.alibaba.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:280) at com.alibaba.dubbo.remoting.transport.AbstractClient$1.run(AbstractClient.java:145) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) 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) ```
dubbo服务已启动,作为消费者的我调用服务端的接口,一直报错
错误如图,有没有大神解释一下这是为啥子@_@![![图片说明](https://img-ask.csdn.net/upload/201802/01/1517414531_602045.png)图片说明](https://img-ask.csdn.net/upload/201802/01/1517414523_949781.png) 附上错误信息:[DUBBO] Decode request failed: com/esotericsoftware/kryo/KryoException, dubbo version: 2.8.4, current host: 169.xxx.xxx.70 java.lang.NoClassDefFoundError: com/esotericsoftware/kryo/KryoException
dubbo线程池问题,线程数一直增长
dubbo应用线程数一直在增加不释放,dubbo:provider 默认采用fixed线程池实现,默认线程池数为100,但DubboServerHandler线程是为150多 处于WAITING状态,正常吗,总不能这样一直增下去,求解?
Dubbo 启动有遇到多这种问题吗?
24-Jun-2018 09:44:30.854 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.49 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 19 2018 20:21:23 UTC 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.49.0 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.10.0-693.5.2.el7.x86_64 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/local/src/java/jre 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_152-b16 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/tomcats/XXXXXX_server 24-Jun-2018 09:44:30.858 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/tomcats/XXXXXX_server 24-Jun-2018 09:44:30.859 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Djava.util.logging.config.file=/opt/tomcats/XXXXXX_server/conf/logging.properties 24-Jun-2018 09:44:30.859 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 24-Jun-2018 09:44:30.859 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Djdk.tls.ephemeralDHKeySize=2048 24-Jun-2018 09:44:30.860 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Djava.protocol.handler.pkgs=org.apache.catalina.webresources 24-Jun-2018 09:44:30.860 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Xdebug 24-Jun-2018 09:44:30.860 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Xnoagent 24-Jun-2018 09:44:30.860 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Djava.compiler=NONE 24-Jun-2018 09:44:30.860 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8788 24-Jun-2018 09:44:30.860 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Dignore.endorsed.dirs= 24-Jun-2018 09:44:30.861 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Dcatalina.base=/opt/tomcats/XXXXXX_server 24-Jun-2018 09:44:30.861 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Dcatalina.home=/opt/tomcats/XXXXXX_server 24-Jun-2018 09:44:30.861 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: - Djava.io.tmpdir=/opt/tomcats/XXXXXX_server/temp 24-Jun-2018 09:44:30.861 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 24-Jun-2018 09:44:31.034 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio- 8080"] 24-Jun-2018 09:44:31.044 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 24-Jun-2018 09:44:31.046 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio- 8009"] 24-Jun-2018 09:44:31.048 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 24-Jun-2018 09:44:31.048 信息 [main] org.apache.catalina.startup.Catalina.load sInitialization processed in 556 ms 24-Jun-2018 09:44:31.070 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina 24-Jun-2018 09:44:31.071 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.49 24-Jun-2018 09:44:31.098 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /opt/tomcats/XXXXXX_server/webapps/ROOT.war 24-Jun-2018 09:44:37.505 信息 [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 2018-06-24 09:44:38 [ localhost-startStop-1:0 ] - [ INFO ] using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter 2018-06-24 09:44:38 [ localhost-startStop-1:6 ] - [ ERROR ] com.alibaba.dubbo.common.Version.checkDuplicate (Version.java:144) [DUBBO] Duplicate class com/alibaba/dubbo/common/Version.class in 2 jar [file:/opt/tomcats/XXXXXX_server/webapps/ROOT/WEB-INF/lib/dubbo-common- 2.8.4.jar!/com/alibaba/dubbo/common/Version.class, file:/opt/tomcats/XXXXXX_server/webapps/ROOT/WEB-INF/lib/dubbo- 2.8.4.jar!/com/alibaba/dubbo/common/Version.class], dubbo version: 2.8.4, current host: 127.0.0.1 2018-06-24 09:44:38 [ localhost-startStop-1:8 ] - [ ERROR ] com.alibaba.dubbo.common.Version.checkDuplicate (Version.java:144) [DUBBO] Duplicate class com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class in 2 jar [file:/opt/tomcats/XXXXXX_server/webapps/ROOT/WEB-INF/lib/dubbo-config-spring- 2.8.4.jar!/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class, file:/opt/tomcats/XXXXXX_server/webapps/ROOT/WEB-INF/lib/dubbo- 2.8.4.jar!/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class], dubbo version: 2.8.4, current host: 127.0.0.
java tomcat dubbo服务关闭失败
25-Dec-2019 13:10:35.326 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance. 25-Dec-2019 13:10:35.328 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8050"] 25-Dec-2019 13:10:35.332 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8059"] 25-Dec-2019 13:10:35.333 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina] 25-Dec-2019 13:10:35.384 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] 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. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 25-Dec-2019 13:10:45.373 INFO [localhost-startStop-1-SendThread(172.30.1.172:2181)] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [ch.qos.logback.core.status.WarnStatus]. 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 [ch.qos.logback.core.status.WarnStatus]. 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:1328) at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1316) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1175) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1136) at ch.qos.logback.classic.LoggerContext.noAppenderDefinedWarning(LoggerContext.java:186) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:264) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:421) at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383) at ch.qos.logback.classic.Logger.debug(Logger.java:482) at org.apache.zookeeper.ClientCnxn$SendThread.readResponse(ClientCnxn.java:742) at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:94) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:366) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141) 25-Dec-2019 13:10:45.377 INFO [localhost-startStop-1-SendThread(172.30.1.172:2181)] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [ch.qos.logback.classic.spi.ThrowableProxy]. 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 [ch.qos.logback.classic.spi.ThrowableProxy]. 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:1328) at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1316) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1175) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1136) at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:119) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419) at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383) at ch.qos.logback.classic.Logger.warn(Logger.java:692) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1162)
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Vue + Spring Boot 项目实战(十四):用户认证方案与完善的访问拦截
本篇文章主要讲解 token、session 等用户认证方案的区别并分析常见误区,以及如何通过前后端的配合实现完善的访问拦截,为下一步权限控制的实现打下基础。
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
Android 9.0系统新特性,对刘海屏设备进行适配
其实Android 9.0系统已经是去年推出的“老”系统了,这个系统中新增了一个比较重要的特性,就是对刘海屏设备进行了支持。一直以来我也都有打算针对这个新特性好好地写一篇文章,但是为什么直到拖到了Android 10.0系统都发布了才开始写这篇文章呢?当然,一是因为我这段时间确实比较忙,今年几乎绝大部分的业余时间都放到写新书上了。但是最主要的原因并不是这个,而是因为刘海屏设备的适配存在一定的特殊性
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
日均350000亿接入量,腾讯TubeMQ性能超过Kafka
整理 | 夕颜出品 | AI科技大本营(ID:rgznai100) 【导读】近日,腾讯开源动作不断,相继开源了分布式消息中间件TubeMQ,基于最主流的 OpenJDK8开发的
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
相关热词 c# 二进制截断字符串 c#实现窗体设计器 c#检测是否为微信 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片
立即提问