插件启动服务端消费端正常,浏览器报错如下:
HTTP Status 500 - Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method queryNow in the service com.taotao.service.TestService. Tried 3 times of the providers 192.168.0.101:20880 from the registry 192.168.25.128:2181 on the consumer 192.168.0.101 using the dubbo version 2.5.3. Last error is: Invoke remote method timeout. method: queryNow, provider: dubbo://192.168.0.101:20880/com.taotao.service.TestService?anyhost=true&application=taotao-manager-web&check=false&dubbo=2.5.3&interface=com.taotao.service.TestService&methods=queryNow&pid=2352&revision=0.0.1-SNAPSHOT&side=consumer×tamp=1541930359643, cause: Waiting server-side response timeout. start time: 2018-11-11 17:59:32.747, end time: 2018-11-11 17:59:33.749, client elapsed: 1 ms, server elapsed: 1001 ms, timeout: 1000 ms, request: Request [id=2, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=queryNow, parameterTypes=[], arguments=[], attachments={path=com.taotao.service.TestService, interface=com.taotao.service.TestService, version=0.0.0}]], channel: /192.168.0.101:58405 -> /192.168.0.101:20880
接口如下:
public interface TestMapper{
pubilc String queryNow();
}
实现如下:
select NOW()
表现层如下
@Controller
public class TestController {
@Autowired
private TestService testservice;
/**
* 测试dubbo配置是否正常
* @return
*/
@RequestMapping("/test/queryNow")
@ResponseBody
public String queryNow(){
return testservice.queryNow();
}
}
dubbo配置都是复制学习资料,查了很多遍肯定没问题。timeout已经设置过,无论设多长时间就报多长时间的错。没用
dubbo 配置里面这个接口的引用超时时间设置长一点试一下
1.我希望你还能看到我的答案
2.我和你报一样的错误,我希望你的配置和我一样,你是否用的MYSQL8
3.如果是,恭喜你,你可以试一试把数据库连接驱动jar换成8以上的,然后重新安装maven model,重新启动,大概就好了
4.如果你OK了,那么这个问题就是MYSQL8却用了5的连接驱动,他不兼容,你可以用conn获取看看,能否获取到,我是往下做到分页插件,突发奇想结果获取不到conn,显示无法获取数据库服务,于是我换的链接,在你换成8驱动,同时dp.properties里面的driver 改为com.mysql.cj.jdbc.Driver之后,重新安装所有的taotao maven项目,然后重新启动,我是这么好了的.
5.如果能帮到你就太好了,前路漫漫,一起努力.
改成@Reference注解试试