Bug1 : 测试程序运行失败

测试类所在包(ctrl)与目标所在包(controller)不一致

修改测试类上面的注解, 带上classes参数

      

 

测试输出结果:

 

Bug 2: 找不到bean对象

Description:

Field myProperties in com.wnc.sboot1.controller.UserController required a bean of type 'com.wnc.sboot1.config.MyProperties' that could not be found.

Action:

Consider defining a bean of type 'com.wnc.sboot1.config.MyProperties' in your configuration.

    

 

修改: 

启动方式改为App.class. controller层去掉@EnableAutoConfiguration

Bug 3: 找不到spring-boot-starter-redis

改为***-data-redis

 

Bug 4: mongodb登陆权限

首先将配置文件中的auth改为false,"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --config "D:\MongoDB\mongo.conf" 运行服务

然后新建用户: 

db.createUser({user:"test",pwd:"test",roles:["readWrite", "dbAdmin", "root"]})

再将auth改为true,然后安装服务,在net start mongodb启动服务

 

posted on 2017-11-05 22:13  龙年生  阅读(192)  评论(0)    收藏  举报