【Springboot+Dubbo】常见报错解决

java.lang.NoClassDefFoundError: org/apache/curator/RetryPolicy

在pom.xml中加上依赖

		<dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-framework</artifactId>
            <version>2.8.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-recipes</artifactId>
            <version>2.8.0</version>
    	</dependency>

nested exception is java.lang.IllegalStateException: No application config found or it’s not a valid config! Please add <dubbo:application name="…" /> to your spring config.

这里我的解决方法是把dubbo换成org.apache.dubbo,确保jdk版本为1.8
将application.properties内加入,注意!这里不是spring为前缀!

dubbo.server=true
dubbo.application.name=springboot-dubbo-provider
dubbo.registry.address=zookeeper://localhost:2181

org.apache.dubbo.rpc.RpcException: please check status of providers(disabled, not registered or in blacklist).

在Application上加上@DubboComponentScan注解

@SpringBootApplication
@DubboComponentScan
public class Application {

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}

}

Opening socket connection to server kubernetes.docker.internal/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)

zookeeper服务未开启


Invocation of init method failed; nested exception is java.lang.ExceptionInInitial

将jdk版本与dubbo支持版本对应,一般java1.8


有一些错误将mvn clean一下就ok了


版权声明:本文为qq_33985931原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。