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
After the basic configuration is completed, the service producer starts normally, but the service consumer keeps appearing this exception. It is indeed a long time toss without any ideas. Unintentionally, I turned to this article to solve my doubts, http://blog.csdn. net/doegoo/article/details/52690018 , I'll ponder it when I have time.
This problem only occurs in SpringBoot's developer tools. Just remove the following dependencies to solve this problem:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>
When log4j.properties is not added, the startup log is completely normal, but it does not work. Adjust the log level to the debug level, and find the exception as follows, the two classes are not found
java.lang.ClassNotFoundException: org.springframework.security.config.annotation.web.configuration.EnableWebSecurity java.lang.ClassNotFoundException: org.springframework.data.web.config.EnableSpringDataWebSupport
Do a search and add two dependencies to solve this problem:
<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>
[Scan the code to follow to get more exciting content]