前言:最新开发中很多新建的项目重构,遇到很多启动异常,因此进行归类整理如下
目录
1.[ERROR] Failed to execute goal maven-resources-plugin:3.2.0:resources Input length = 1 -> [Help 1]
3.springMvc 项目 The server refused this request because the request entity is in a format
1.[ERROR] Failed to execute goal maven-resources-plugin:3.2.0:resources Input length = 1 -> [Help 1]
使用maven 3.2.0版本 对SpringBoot项目进行打包的时候,打包失败报错如下
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project springboot_devtools_demo1: Input length = 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
问题解决:
最初有很多博客说是修改配置文件编码格式为UTF-8,在测试过程中,没有生效解决。
查看了Maven版本以及springboot 版本,因为当前使用的springboot为2.1.9 而maven版本较高,为最新的3.2.0;可能是版本冲突导致,于是降低maven版本到3.1.0 编译后可以生效。
2.java.lang.NoClassDefFoundError:org/springframework/transaction/interceptor/TransactionAspectSupport
问题处理链接如下:
3.springMvc 项目 The server refused this request because the request entity is in a format
请求报http编码 415:
需要检查的点:
1.请求入参格式,是用的@RequestParam注解还是@RequestBody注解
RequestBody注解的需要使用的application/json格式化的实体参数
RequestParam 注解需要使用的text/plain等格式。以上俩种格式对应spring-mvc配置文件种如下配置 <mvc:annotation-driven>
<mvc:annotation-driven>
<mvc:message-converters register-defaults="false">
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="utf-8"/>
</bean>
<bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter"/>
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
版权声明:本文为博主原创文章,转载请注明本页地址。https://blog.csdn.net/l1994m/article/details/120449103