登录出现问题

登录出现问题

下载了源码,并且导入了数据库。使用testbind+123456点击登录没有反应,自己去数据库手动创建一个账号也是一样,然后按F12查看报错如下,不知是哪里出了问题?

http://img1.sycdn.imooc.com//climg/5e9feea3092fcf8f19110749.jpg

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

8回答
好帮手慕阿满 2020-04-23 17:53:31

同学你好,这里是因为缺少构造器而提示报错,但是不影响项目运行。或者同学可以添加带参构造函数消除报错:如:

http://img1.sycdn.imooc.com//climg/5ea16550098a418705130210.jpg

http://img1.sycdn.imooc.com//climg/5ea16577098b736f05330328.jpg

http://img1.sycdn.imooc.com//climg/5ea1659409d0831405430362.jpg

祝:学习愉快~


提问者 Double07 2020-04-23 14:31:17
好帮手慕阿满 2020-04-23 13:54:17

同学你好,这是Redis造成的报错,问一下同学的redis是否已经启动。

另外建议同学检查一下spring-redis.xml中是否有如下的配置文件:

http://img1.sycdn.imooc.com//climg/5ea12d81099f970f09270145.jpg

祝:学习愉快~

  • 提问者 Double07 #1
    Redis以及启动,检查到spring-redis.xml中如上图报错。按照IDEA自带的提示alt+shift+enter在JedisUtil中创建了构造器还是没用,依然报这个No qualifying bean of type 'com.imooc.o2o.cache.JedisUtil$Keys' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}的错误
    2020-04-23 14:30:48
提问者 Double07 2020-04-22 19:32:38


http://img1.sycdn.imooc.com//climg/5ea02acf09d22df217510583.jpgNo qualifying bean of type 'com.imooc.o2o.cache.JedisUtil$Keys' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}


http://img1.sycdn.imooc.com//climg/5ea02b02096bcccc17460708.jpg

Unsatisfied dependency expressed through field 'jedisKeys'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.imooc.o2o.cache.JedisUtil$Keys' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

http://img1.sycdn.imooc.com//climg/5ea02b43090748c117430292.jpgNo qualifying bean of type 'com.imooc.o2o.cache.JedisUtil$Keys' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

好帮手慕阿满 2020-04-22 19:01:12

同学你好,这里可能是由于添加Redis后造成的报错,如:

http://img1.sycdn.imooc.com//climg/5ea023d909289c2c18220426.jpg

建议同学将报错信息贴完整,方便我们查看具体问题。

祝:学习愉快~

  • 提问者 Double07 #1
    已完整贴出,每一张图里太长截不完的地方也相应地用文本复制上来了
    2020-04-22 19:34:14
提问者 Double07 2020-04-22 18:13:44

http://img1.sycdn.imooc.com//climg/5ea0189509d5c18a17630699.jpgUnsatisfied dependency expressed through field 'jedisKeys'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.imooc.o2o.cache.JedisUtil$Keys' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

提问者 Double07 2020-04-22 18:06:37
好帮手慕阿满 2020-04-22 17:08:12

同学你好,这边测试源码,可以正常登录。从同学的截图中看,logincheck后边应该是有参数的,但是并没有参数名,如:

http://img1.sycdn.imooc.com//climg/5ea00862098f9a1d05120051.jpg

这里建议同学查看一下控制台是否有报错。另外建议同学重启项目,再次访问试试。

祝:学习愉快~

  • 提问者 Double07 #1
    重启没有用,还是没反应,我把那个下拉的箭头点开发出来了
    2020-04-22 18:07:16
  • 提问者 Double07 #2
    会不会是我Redis的代码有问题?我把Redis的代码导入进来,以前可以正常运行的测试用例都报了这个错(报错代码已发到上面),麻烦请您看看
    2020-04-22 18:15:38
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师