alibaba / dubbo-spring-boot-starter Goto Github PK
View Code? Open in Web Editor NEWDubbo Spring Boot Starter
License: Apache License 2.0
Dubbo Spring Boot Starter
License: Apache License 2.0
在springboot 中一般都是通过profile来区分配置文件,纯注解dubbo的@reference 来添加版本时,会造成开发、测试、生产环境的版本不一致的困扰!!!
另外,发现当前版本的spring.dubbo.registry=zookeeper://...:2181 只能配置一个地址,建议添加轮询实现,提供消费服务的可用性!!!
在Shiro 的realm中注入dubbo 服务 总是 null
spring.dubbo.registry=multicast://224.0.0.0:1111
这个只能是一个,不能是多个吗?
多个报异常Caused by: java.lang.NumberFormatException: For input string
dubbo@Service spring的@transactional一起使用, 无法发布服务,
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>spring-boot-starter-dubbo</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
按照首页的配置引用之后,并不能加载这个依赖,查了**仓库也没有,是还没上传吗?
在application.properties中配置zookeeper的多个注册中心,按照以前的思路,多个注册中心用英文逗号(,)隔开,但会出现java.lang.NumberFormatException异常
进入源码查看,发现问题是没有解决分隔符,改成“|”,但又出现别的错误
是不是Dubbo的Spring Boot没上传到**仓库?
dubbo:method/ 这个配置,是否支持
如何实现多种协议配置,如同时支持dubbo和rest协议?
怎么配置 <dubbo:monitor protocol="registry"/>
必须要配置zkclient,必须要配置zkclient,必须要配置zkclient
好像这个starter没加入到**仓库中去,然后maven也下载不到?
这可能不是什么BUG,是功能要求吧。
请问有没有什么打算,支持 标准 SpringBoot 配置的写法,而不是xml配置。
@configuration 这种...
Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to register dubbo://10.0.73.219:20901/org.jsfund.weal.core.service.UserService?anyhost=true&application=jsfundService&default.loadbalance=roundrobin&default.threadpool=fixed&default.threads=10&default.timeout=25000&dispatcher=all&dubbo=2.5.3&interface=org.jsfund.weal.core.service.UserService&methods=queryByCondition,selectByPrimaryKey,insertSelective,isValidate,updateByPrimaryKey,deleteByPrimaryKey,insert,updateByPrimaryKeySelective,updateByPhoneSelective&owner=service&pid=13840&retries=0&revision=1.0&side=provider&threadpool=cached&threads=5000&timeout=30000×tamp=1509607712570&version=1.0 to zookeeper zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=jsfundService&dubbo=2.5.3&interface=com.alibaba.dubbo.registry.RegistryService&owner=service&pid=13840&timeout=25000×tamp=1509607712570, cause: org.apache.zookeeper.KeeperException$NoAuthException: KeeperErrorCode = NoAuth for /dubbo/org.jsfund.weal.core.service.UserService
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:102)
at com.alibaba.dubbo.registry.support.FailbackRegistry.register(FailbackRegistry.java:130)
... 23 common frames omitted
Caused by: org.I0Itec.zkclient.exception.ZkException: org.apache.zookeeper.KeeperException$NoAuthException: KeeperErrorCode = NoAuth for /dubbo/org.jsfund.weal.core.service.UserService
at org.I0Itec.zkclient.exception.ZkException.create(ZkException.java:68)
at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:1000)
at org.I0Itec.zkclient.ZkClient.create(ZkClient.java:527)
at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:293)
at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:270)
at com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient.createPersistent(ZkclientZookeeperClient.java:43)
at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:44)
at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:39)
at com.alibaba.dubbo.remoting.zookeeper.support.AbstractZookeeperClient.create(AbstractZookeeperClient.java:39)
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doRegister(ZookeeperRegistry.java:100)
... 24 common frames omitted
Caused by: org.apache.zookeeper.KeeperException$NoAuthException: KeeperErrorCode = NoAuth for /dubbo/org.jsfund.weal.core.service.UserService
at org.apache.zookeeper.KeeperException.create(KeeperException.java:113)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
at org.I0Itec.zkclient.ZkConnection.create(ZkConnection.java:99)
at org.I0Itec.zkclient.ZkClient$3.call(ZkClient.java:530)
at org.I0Itec.zkclient.ZkClient$3.call(ZkClient.java:527)
at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:990)
spring:
dubbo:
appname: spring-boot-starter-dubbo-provider-test
registry: zookeeper://127.0.0.1:2181?backup=127.0.0.1:2182,127.0.0.1:2183
protocol: dubbo
我的springboot的配置是这样的,但是节点一直没有注册成功,导致服务不可用,这是为什么呢?
建议在DubboProperties中添加check字段,对注册中心做启动时检查
把这个依赖放在maven里,idea找不到这个依赖是为什么
都是 期待
DubboProperties里面支持的配置太少,怎么通过配置过滤掉dubbo默认的filter
提交**仓库,方便使用,多谢!
开发工具用的idea,引入dubbo包后,每次停止tomcat都报如下错误
java.lang.NoClassDefFoundError: org/apache/jute/CsvOutputArchive
at org.apache.zookeeper.proto.RequestHeader.toString(RequestHeader.java:62)
at java.lang.String.valueOf(String.java:2994)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at org.apache.zookeeper.ClientCnxn$Packet.toString(ClientCnxn.java:326)
at java.lang.String.valueOf(String.java:2994)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at org.apache.zookeeper.ClientCnxn$SendThread.readResponse(ClientCnxn.java:844)
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)
Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [org.apache.jute.CsvOutputArchive]. 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.checkStateForClassLoading(WebappClassLoaderBase.java:1301)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1158)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
... 10 more
Caused by: java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org.apache.jute.CsvOutputArchive]. 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:1311)
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1299)
... 12 more
I search all over places for official documentation, tutorials, found following solutions, all not working ... not found in any public maven repository, improve your code & documentation quality please!!!
Don't publish until you have personally tested it working, it's a very basic coding discipline.
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>spring-boot-starter-dubbo</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.dubbo</groupId>
<artifactId>spring-boot-starter-dubbo</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
ubuntu下有广播连接的问题
当服务提供和服务消费在同一个包时,提供的服务会被注册两次
com.alibaba.dubbo.remoting.RemotingException: Not found exported service: com.alibaba.dubbo.registry.RegistryService:9090 in [com.alibaba.dubbo.monitor.MonitorService:9090], may be version or group mismatch , channel: consumer: /10.0.10.246:51384 --> provider: /10.0.10.246:9090, message:RpcInvocation [methodName=subscribe, parameterTypes=[class com.alibaba.dubbo.common.URL, interface com.alibaba.dubbo.registry.NotifyListener], arguments=[consumer://10.0.10.246/com.alibaba.dubbo.registry.RegistryService?application=dubbo-spring-boot-starter-consumer-test&callbacks=10000&connect.timeout=10000&dubbo=2.6.0&interface=com.alibaba.dubbo.registry.RegistryService&lazy=true&methods=lookup,unsubscribe,subscribe,unregister,register&pid=2397&reconnect=false&sticky=true&subscribe.1.callback=true&timeout=10000×tamp=1516761688291&unsubscribe.1.callback=false, null], attachments={path=com.alibaba.dubbo.registry.RegistryService, input=870, sys_callback_arg-1=1089341986, dubbo=2.6.0, interface=com.alibaba.dubbo.registry.RegistryService, version=0.0.0, timeout=10000}]
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(DubboProtocol.java:217)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:86)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82)
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)
Provider启动日志:
/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:51377,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/lib/tools.jar:/Users/rollin/dh/gitDH/dubbo-spring-demo/provider/target/classes:/Users/rollin/dh/gitDH/dubbo-spring-demo/api/target/classes:/Users/rollin/.m2/repository/com/alibaba/spring/boot/dubbo-spring-boot-starter/1.0.0/dubbo-spring-boot-starter-1.0.0.jar:/Users/rollin/.m2/repository/com/alibaba/dubbo/2.6.0/dubbo-2.6.0.jar:/Users/rollin/.m2/repository/org/springframework/spring-context/4.3.10.RELEASE/spring-context-4.3.10.RELEASE.jar:/Users/rollin/.m2/repository/org/springframework/spring-aop/4.3.10.RELEASE/spring-aop-4.3.10.RELEASE.jar:/Users/rollin/.m2/repository/org/springframework/spring-core/4.3.10.RELEASE/spring-core-4.3.10.RELEASE.jar:/Users/rollin/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/rollin/.m2/repository/org/springframework/spring-expression/4.3.10.RELEASE/spring-expression-4.3.10.RELEASE.jar:/Users/rollin/.m2/repository/org/springframework/spring-beans/4.3.10.RELEASE/spring-beans-4.3.10.RELEASE.jar:/Users/rollin/.m2/repository/org/springframework/spring-web/4.3.10.RELEASE/spring-web-4.3.10.RELEASE.jar:/Users/rollin/.m2/repository/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.jar:/Users/rollin/.m2/repository/org/jboss/netty/netty/3.2.5.Final/netty-3.2.5.Final.jar:/Users/rollin/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/1.5.9.RELEASE/spring-boot-starter-actuator-1.5.9.RELEASE.jar:/Users/rollin/.m2/repository/org/springframework/boot/spring-boot-starter/1.5.9.RELEASE/spring-boot-starter-1.5.9.RELEASE.jar:/Users/rollin/.m2/repository/org/springframework/boot/spring-boot/1.5.9.RELEASE/spring-boot-1.5.9.RELEASE.jar:/Users/rollin/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.5.9.RELEASE/spring-boot-autoconfigure-1.5.9.RELEASE.jar:/Users/rollin/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.5.9.RELEASE/spring-boot-starter-logging-1.5.9.RELEASE.jar:/Users/rollin/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar:/Users/rollin/.m2/repository/ch/qos/logback/logback-core/1.1.11/logback-core-1.1.11.jar:/Users/rollin/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.jar:/Users/rollin/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:/Users/rollin/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.25/log4j-over-slf4j-1.7.25.jar:/Users/rollin/.m2/repository/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar:/Users/rollin/.m2/repository/org/springframework/boot/spring-boot-actuator/1.5.9.RELEASE/spring-boot-actuator-1.5.9.RELEASE.jar:/Users/rollin/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.10/jackson-databind-2.8.10.jar:/Users/rollin/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar:/Users/rollin/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.10/jackson-core-2.8.10.jar:/Users/rollin/.m2/repository/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.jar:/Users/rollin/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar:/Users/rollin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar:/Users/rollin/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar:/Users/rollin/.m2/repository/jline/jline/0.9.94/jline-0.9.94.jar:/Users/rollin/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/Users/rollin/.m2/repository/io/netty/netty/3.7.0.Final/netty-3.7.0.Final.jar:/Users/rollin/.m2/repository/com/github/sgroschupf/zkclient/0.1/zkclient-0.1.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar" com.ceair.ec.DubboProviderLauncher
Connected to the target VM, address: '127.0.0.1:51377', transport: 'socket'
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/rollin/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/rollin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: The requested version 1.7.16 by your slf4j binding is not compatible with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )__ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' || .__|| ||| |_, | / / / /
=========||==============|/=////
:: Spring Boot :: (v1.5.9.RELEASE)
2018-01-24 10:41:21.023 INFO 2364 --- [ main] com.ceair.ec.DubboProviderLauncher : Starting DubboProviderLauncher on RulindeMacBook-Pro.local with PID 2364 (/Users/rollin/dh/gitDH/dubbo-spring-demo/provider/target/classes started by rollin in /Users/rollin/dh/gitDH/dubbo-spring-demo)
2018-01-24 10:41:21.029 INFO 2364 --- [ main] com.ceair.ec.DubboProviderLauncher : No active profile set, falling back to default profiles: default
2018-01-24 10:41:21.113 INFO 2364 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@625732: startup date [Wed Jan 24 10:41:21 CST 2018]; root of context hierarchy
2018-01-24 10:41:22.001 INFO 2364 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.dubbo-com.alibaba.dubbo.spring.boot.DubboProperties' of type [com.alibaba.dubbo.spring.boot.DubboProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 10:41:22.008 INFO 2364 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.dubbo.spring.boot.DubboAutoConfiguration' of type [com.alibaba.dubbo.spring.boot.DubboAutoConfiguration$$EnhancerBySpringCGLIB$$8ed25214] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 10:41:22.023 INFO 2364 --- [ main] c.a.dubbo.common.logger.LoggerFactory : using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter
2018-01-24 10:41:22.031 INFO 2364 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dubboApplicationConfig' of type [com.alibaba.dubbo.config.ApplicationConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 10:41:22.036 INFO 2364 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dubboRegistryConfig' of type [com.alibaba.dubbo.config.RegistryConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 10:41:22.037 INFO 2364 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration' of type [com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration$$EnhancerBySpringCGLIB$$5b179ffe] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 10:41:22.574 INFO 2364 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-01-24 10:41:22.640 INFO 2364 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2018-01-24 10:41:22.714 INFO 2364 --- [ main] com.ceair.ec.DubboProviderLauncher : Started DubboProviderLauncher in 2.009 seconds (JVM running for 2.447)
配置文件的registry如下:
spring.dubbo.registry=multicast:224.5.6.7:1234
官方文档对第三方 Starter 的建议:Do not start your module names with spring-boot, even if you are using a different Maven groupId. We may offer an official support for the thing you’re auto-configuring in the future.
可以参考 Mybtais 的 POM:
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
使用自定义注解(注解方法)的注解服务,服务注册不上。
是改名字了么?
以上依赖在maven仓库未找到。另外在阿里的仓库中也未找到
按照说明中的配置,配置了一个服务方,启动没看到异常,但是会自己退出
application.properties配置如下
spring.dubbo.group=develop
spring.dubbo.appname=coupon-server
spring.dubbo.registry=zookeeper://127.0.0.1:2181
启动类配置如下:
@SpringBootApplication
@EnableDubboConfiguration
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
服务实现类配置如下:
@Slf4j
@Service(interfaceClass = CouponService.class)
public class DefaultCouponService implements CouponService {}
启动日志如下:
`2018-01-24 18:05:11.629 INFO 71204 --- [ main] c.w.c.backend.coupon.server.Application : Starting Application on PCOS-1708271131 with PID 71204 (E:\Workspace-Online\backend-coupon\backend-coupon-server\target\classes started by Administrator in E:\Workspace-Online\backend-coupon)
2018-01-24 18:05:11.632 INFO 71204 --- [ main] c.w.c.backend.coupon.server.Application : No active profile set, falling back to default profiles: default
2018-01-24 18:05:11.688 INFO 71204 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@115b28: startup date [Wed Jan 24 18:05:11 CST 2018]; root of context hierarchy
2018-01-24 18:05:12.326 INFO 71204 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.dubbo-com.alibaba.dubbo.spring.boot.DubboProperties' of type [com.alibaba.dubbo.spring.boot.DubboProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 18:05:12.331 INFO 71204 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.dubbo.spring.boot.DubboAutoConfiguration' of type [com.alibaba.dubbo.spring.boot.DubboAutoConfiguration$$EnhancerBySpringCGLIB$$874dbd78] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 18:05:12.339 INFO 71204 --- [ main] c.a.dubbo.common.logger.LoggerFactory : using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter
2018-01-24 18:05:12.346 INFO 71204 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dubboApplicationConfig' of type [com.alibaba.dubbo.config.ApplicationConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 18:05:12.353 INFO 71204 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dubboRegistryConfig' of type [com.alibaba.dubbo.config.RegistryConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 18:05:12.354 INFO 71204 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration' of type [com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration$$EnhancerBySpringCGLIB$$53930b62] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-24 18:05:12.856 INFO 71204 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-01-24 18:05:12.862 INFO 71204 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2018-01-24 18:05:12.915 INFO 71204 --- [ main] c.w.c.backend.coupon.server.Application : Started Application in 1.505 seconds (JVM running for 2.018)
2018-01-24 18:05:12.915 INFO 71204 --- [ Thread-5] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@115b28: startup date [Wed Jan 24 18:05:11 CST 2018]; root of context hierarchy
2018-01-24 18:05:12.916 INFO 71204 --- [ Thread-5] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2018-01-24 18:05:12.917 INFO 71204 --- [ Thread-5] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2018-01-24 18:05:12.918 INFO 71204 --- [bboShutdownHook] com.alibaba.dubbo.config.AbstractConfig : [DUBBO] Run shutdown hook now., dubbo version: 2.6.0, current host: 127.0.0.1
2018-01-24 18:05:12.918 INFO 71204 --- [bboShutdownHook] c.a.d.r.support.AbstractRegistryFactory : [DUBBO] Close all registries [], dubbo version: 2.6.0, current host: 127.0.0.1
Disconnected from the target VM, address: '127.0.0.1:62379', transport: 'socket'
Process finished with exit code 0`
maven 的中心 repo 搜不到记录。
编译报错:
Could not find artifact com.alibaba:spring-boot-starter-dubbo:jar:1.0.0-SNAPSHOT -> [Help 1]
怎么避免provider不存在时,所抛出异常影响其他功能使用。
when set multi:
spring.dubbo.registry=zookeeper://xx.17.xx.xx:2181,xx.17.xx.153:2181,xx.17.xx.154:2181
then show this:
Caused by: org.springframework.beans.factory.BeanCreationException: uploadComponent; nested exception is java.lang.NumberFormatException: For input string: "2181,xx.17.xx.153:2181,xx.17.xx.154:2181"
at com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration$1.postProcessBeforeInitialization(DubboConsumerAutoConfiguration.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554)
... 20 common frames omitted
Caused by: java.lang.NumberFormatException: For input string: "2181,xx.17.xx.153:2181,xx.17.xx.154:2181"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at com.alibaba.dubbo.common.URL.valueOf(URL.java:237)
at com.alibaba.dubbo.common.utils.UrlUtils.parseURL(UrlUtils.java:68)
at com.alibaba.dubbo.common.utils.UrlUtils.parseURLs(UrlUtils.java:137)
at com.alibaba.dubbo.config.AbstractInterfaceConfig.loadRegistries(AbstractInterfaceConfig.java:190)
at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:378)
at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333)
at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163)
at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:59)
at com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration$1.postProcessBeforeInitialization(DubboConsumerAutoConfiguration.java:93)
... 23 common frames omitted
请问这个现在在springboot的项目中应用的话是不是不能通过@ImportResource去加载dubbo的xml配置文件呢??
绑定host配置
如何在application.properties中设置重试次数,dubbo传统方式有非常多得调优参数可以设置,集成到springboot后,这些参数的组合规则是什么样的?
Caused by: java.lang.IllegalArgumentException: interface com.qf.posp.depo.notify.api.api.INotifyRecordService is not visible from class loader
at com.alibaba.dubbo.common.bytecode.Proxy.getProxy(Proxy.java:98) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.common.bytecode.Proxy.getProxy(Proxy.java:67) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:35) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.rpc.proxy.AbstractProxyFactory.getProxy(AbstractProxyFactory.java:49) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.rpc.proxy.wrapper.StubProxyFactoryWrapper.getProxy(StubProxyFactoryWrapper.java:60) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.rpc.ProxyFactory$Adpative.getProxy(ProxyFactory$Adpative.java) ~[na:2.5.3]
at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:426) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:300) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:138) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:65) ~[dubbo-2.5.3.jar:2.5.3]
at com.alibaba.boot.dubbo.DubboConsumerAutoConfiguration$1.postProcessBeforeInitialization(DubboConsumerAutoConfiguration.java:96) ~[spring-boot-starter-dubbo-1.0.0-SNAPSHOT.jar:na]
... 23 common frames omitted
启动报错信息如下:
2017-10-31 11:40:52.022 ERROR 77982 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoConsumer' defined in file [/Users/simon/Workspace/java-web/mvn/multimodule/module3/target/classes/com/chltec/DemoConsumer.class]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool$Config
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE]
at com.chltec.Module3Application.main(Module3Application.java:12) [classes/:na]
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool$Config
at com.alibaba.dubbo.registry.redis.RedisRegistry.(RedisRegistry.java:88) ~[dubbo-2.5.3.jar:2.5.3]
组件配置:
@component
public class DemoConsumer {
@DubboConsumer
private DemoService demoService;
public String consume(){
return demoService.sayHello("joker");
}
}
dubbo配置:
spring.dubbo.appname=spring-boot-starter-dubbo-consumer-test
spring.dubbo.registry=redis://127.0.0.1:6379
spring.dubbo.protocol=dubbo
为何是snapshot的,正式版都不打一个?
怎么配置多个zookeeper地址,例如:zookeeper://172.16.37.112:2181,172.16.37.112:2182,172.16.37.112:2183
与spring boot集成在IDEA下配置无法高亮也无法自动补全,使用properties配置。
控制台为何打印dubbo的bean不符合代理,下面是日志
Bean 'spring.dubbo-com.alibaba.dubbo.spring.boot.DubboProperties' of type [com.alibaba.dubbo.spring.boot.DubboProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2018-01-25 11:01:00.159 INFO 33212 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.dubbo.spring.boot.DubboAutoConfiguration' of type [com.alibaba.dubbo.spring.boot.DubboAutoConfiguration$$EnhancerBySpringCGLIB$$d10d248] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2018-01-25 11:01:00.171 INFO 33212 --- [ main] c.a.dubbo.common.logger.LoggerFactory : using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter 2018-01-25 11:01:00.182 INFO 33212 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dubboApplicationConfig' of type [com.alibaba.dubbo.config.ApplicationConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2018-01-25 11:01:00.203 INFO 33212 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dubboRegistryConfig' of type [com.alibaba.dubbo.config.RegistryConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
貌似全局超时配置还没有可配置的地方,只有一个配置类DubboProperties,希望能加上全局超时配置,不然默认接口等待时间是1S
我准备在项目中用spring-boot-starter-dubbo,但github上找了好几个,发现这个是阿里title的,但却又是快照版。所以想知道该项目目前是否处于可用状态?谢谢作者!
怎么设置全局timeout?
不能通过 @org.springframework.boot.test.mock.mockito.MockBean 来 mock @DubboConsumer 标注的属性。
作为consumer,接入多个provider的时候,发现appname不能支持多个,也就是只能接一个服务提供方了,请问后续有对多个provider接入的支持吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.