您的位置:首页 > 编程语言 > Java开发

java错题集

2016-01-29 16:21 281 查看
1.reponse可以得到,但浏览器提示No message body writer has been found for...

restapi中没有加下面这个。

@Path("/")
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })

2.启动时Configuration problem: Only one AsyncAnnotationBeanPostProcessor may exist within the context.

spring的配置文件中,多个定时器重复加载就会报这个错

<!-- 定时器 -->
<task:annotation-driven></task:annotation-driven>

3.文件上传tomcat getPart()为null时。有可能是tomcat版本问题,tomcat7以上才支持getPart。如果确认tomcat和web.xml版本都没问题。那么就是web.xml写法有问题。

在servlet类中添加@MultipartConfig(maxFileSize=200000000,fileSizeThreshold=4096) 即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: