Spring Boot 3.2.2 连接 RocketMQ 5.1.2 报错如何解决?
Started container failed. DefaultRocketMQListenerContainer{consumerGroup='topic_02_CONSUMER', namespace='', namespaceV2='', nameServer='192.168.50.20:9876', topic='topic_02', consumeMode=CONCURRENTLY, selectorType=TAG, selectorExpression='*', messageModel=CLUSTERING', tlsEnable=false, instanceNam...
1 回答943 阅读✓ 已解决
方法一配置yml
配置 spring.mvc:static-path-pattern:/**
图片放在resource/static/下面
访问直接ip:端口/图片名称.后缀
注意如果项目中含有实现了WebMvcConfigurer接口的类,上面方法访问将会报404
方法二 实现WebMvcConfigurer接口,重写addResourceHandlers方法
如果有实现了WebMvcConfigurer接口的类,配置需要写在此类的方法上面
yml的spring.mvc:static-path-pattern:/**移除掉
在实现了WebMvcConfigurer接口的类的重写addResourceHandlers方法
图片放在resource/static/下面
访问直接ip:端口/图片名称.后缀