Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我在windows下按序启动,前五个没问题,最后启动网关报错 #2

Open
clcshr opened this issue Nov 10, 2021 · 2 comments

Comments

@clcshr
Copy link

clcshr commented Nov 10, 2021

请问这是啥原因呢?seckillController无法注入?
ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'seckillController' defined in file [D:\dis-seckill-master\dis-seckill-master\dis-seckill-gateway\target\classes\com\seckill\dis\gateway\seckill\SeckillController.class]: Invocation of init method failed; nested exception is org.apache.dubbo.rpc.RpcException: Failed to invoke the method listGoodsVo in the service com.seckill.dis.common.api.goods.GoodsServiceApi. Tried 3 times of the providers [180.201.4.191:12346] (1/2) from the registry 127.0.0.1:2181 on the consumer 180.201.4.191 using the dubbo version 2.7.1.

@parkt90
Copy link
Owner

parkt90 commented Nov 11, 2021

从报错信息上来看,是dis-seckill-goods模块下GoodsServiceApi接口listGoodsVo方法调用的问题。建议查看数据是否能够正常连接和使用

@geek-LHW
Copy link

我已经解决了这个问题,你可以看一下他数据库的配置(在项目的application.properties文件里),你会发现他的用户名是root,密码是1 …… 所以问题很简单了,你把你的用户名和密码改成这个就行了; 如果你看了他的README.MD文件,里面有写到密码是123,如果你改成了123,那么很显然,会访问不了数据库,自然就超时报错了…

请问这是啥原因呢?seckillController无法注入? ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'seckillController' defined in file [D:\dis-seckill-master\dis-seckill-master\dis-seckill-gateway\target\classes\com\seckill\dis\gateway\seckill\SeckillController.class]: Invocation of init method failed; nested exception is org.apache.dubbo.rpc.RpcException: Failed to invoke the method listGoodsVo in the service com.seckill.dis.common.api.goods.GoodsServiceApi. Tried 3 times of the providers [180.201.4.191:12346] (1/2) from the registry 127.0.0.1:2181 on the consumer 180.201.4.191 using the dubbo version 2.7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants