admin管理员组文章数量:1794759
今天启动时候报错Consider defining a bean of type '[Ljava.lang.String;' in your configuration.
今天改了下代码启动时就报下面的错 Description: Parameter 0 of constructor in com.alibaba.fastjson.support.spring.FastJsonpResponseBodyAdvice required a bean of type '[Ljava.lang.String;' that could not be found. Action: Consider defining a bean of type '[Ljava.lang.String;' in your configuration.
咋一看还以为fastJson解析相关的错误 搞了半天不知道啥原因 只好使用排除法检查修改的代码 最后定位到下面问题代码 @ComponentScan(basePackages={"com.nailsoul"}) 改成@ComponentScan(basePackages={"com"}) 经测试basePackages不能为com 否则就会报上面的错 如果com下有多个包需分别引入 ComponentScan(basePackages={"com.nailsoul","com.test"}) 如果设置多个包 Application需要在基包中 否则就只会加载Application所在包下的bean 所有Application必须放在com下
@ServletComponentScan Servlet、Filter、Listener可以直接通过@WebServlet、@WebFilter、@WebListener注解自动注册,无需其他代码
版权声明:本文标题:今天启动时候报错Consider defining a bean of type '[Ljava.lang.String;' in your configuration. 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686552066a80996.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论