启动报错
来源:2-3 运行后端SpringBoot项目(上)

慕莱坞4029081
2022-07-20
你好,我主要有三个问题,代码下下来没有改动过
问题一 启动报错
JDK没问题,maven也不爆红,像是没识别到,百度搜说法不一
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022/07/20 22:56:29 ERROR Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'amectController': Unsatisfied dependency expressed through field 'amectService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'amectServiceImpl': Unsatisfied dependency expressed through field 'myWXPayConfig'; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'myWXPayConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'wx.mch-id' in value "${wx.mch-id}"
问题二 redis
我的redis没有设置密码,yml中这样子写可以正常连接吗?
redis:
database: 0
host: localhost
port: 6379
jedis:
pool:
max-active: 1000
max-wait: -1ms
max-idle: 16
min-idle: 8
问题三
AmectServiceImpl.java中报错
list_1.forEach(one -> {
chart_4_1.forEach(temp -> {
if (MapUtil.getInt(one, "month") == MapUtil.getInt(temp, "month")) {
temp.replace("ct", MapUtil.getInt(one, "ct"));
}
});
});
包装类型间的相等判断应该用equals,而不是’=='
service报错不会影响启动吧?
写回答
2回答
-
神思者
2022-07-21
YML文件中的值注入你没写。redis不设置密码会被注入挖矿病毒。比较数据,不是类型
00 -
慕莱坞4029081
提问者
2022-07-20
server: jetty: threads: acceptors: 4 selectors: 8 port: 8090 servlet: context-path: /emos-api multipart: max-request-size: 10MB max-file-size: 2MB spring: datasource: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/emos?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true username: root password: xueliaokuo initial-size: 2 max-active: 4 min-idle: 4 max-wait: 60000 test-while-idle: true test-on-borrow: false test-on-return: false redis: database: 0 host: localhost port: 6379 jedis: pool: max-active: 1000 max-wait: -1ms max-idle: 16 min-idle: 8 data: mongodb: host: localhost port: 27017 database: emos authentication-database: admin username: admin password: abc123456 sa-token: #token名称 (同时也是cookie名称) token-name: token # token有效期,单位s 默认30天, -1代表永不过期 timeout: 2592000 # token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒 activity-timeout: -1 # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) allow-concurrent-login: true # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) is-share: false # token风格 token-style: uuid #关闭读取Cookie中Token isReadCookie: true mybatis: mapper-locations: classpath*:mapper/*.xml type-aliases-package: com.example.emos.api.db.pojo configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl map-underscore-to-camel-case: true logging: level: root: info com.example.emos.api.db.dao: warn pattern: console: "%d{yyyy/MM/dd HH:mm:ss} %-5level %msg%n" springdoc: api-docs: enabled: true path: /doc-api.html swagger-ui: path: /swagger-ui.html disable-swagger-default-url: on tencent: cloud: appId: 1313007513 secretId: AKIDua3HEySh1B6j58vQcXAWa9QPfpmUyFMH secretKey: oOkskMlxve7MSLxKYXGrBG6g04ugIejY region: ap-nanjing bucket: emos-1313007513 trtc: appId: 1400709540 secretKey: b225c83013a2aa7035858a3e564a206894ec5bf3fcb8523bc064e2b890d4cb7a expire: 86400 wx: app-id: wx45d51e330ec2077a # 微信小程序APPID app-secret: 669a38b835e517f0204b62bf7d9aa970 #微信小程序密钥 # mch-id: 微信支付商户号 # key: 微信支付密钥 # cert-path: 微信支付数字证书文件路径 #emos: # code: 慕课网授权码 # tcode: "课程授权码" # recieveNotify: http://你电脑的IP地址:8090/emos-api/meeting/recieveNotify #workflow: # url: http://你电脑的IP地址:9090/emos-workflow
yml是这样
00
相似问题