Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException: com.guooo.boot.acc.serv.impl.HelloDubboServiceImpl cannot be cast to com.guooo.boot.acc.serv.impl.HelloDubboServiceImpl
at com.alibaba.dubbo.common.bytecode.Wrapper1.invokeMethod(Wrapper1.java)
at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46)
at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72)
... 25 more
Caused by: java.lang.ClassCastException: com.guooo.boot.acc.serv.impl.HelloDubboServiceImpl cannot be cast to com.guooo.boot.acc.serv.impl.HelloDubboServiceImpl
... 28 more
基本的配置完在后,服务生产者正常启动,但服务消费者一直出现这个异常,确实是折腾很久没有任何思路,无意,翻到此篇文章解开心中疑惑,http://blog.csdn.net/doegoo/article/details/52690018,待有时间再细细琢磨。
SpringBoot的开发者工具才出现的这一个问题,只要把下面的依赖去掉就解决了这一个问题:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
没有加log4j.properties时,启动日志完全正常,就是不起作用。把日志级别调到debug级别,发现异常如下 ,两个类没有找到
java.lang.ClassNotFoundException: org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
java.lang.ClassNotFoundException: org.springframework.data.web.config.EnableSpringDataWebSupport
搜索一下,添加两个依赖可解决此问题:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
【扫码关注获取更多精彩内容】