SpringBoot启动异常问题汇总以及Maven常见异常

前言:最新开发中很多新建的项目重构,遇到很多启动异常,因此进行归类整理如下

目录

1.[ERROR] Failed to execute goal maven-resources-plugin:3.2.0:resources Input length = 1 -> [Help 1]

2.java.lang.NoClassDefFoundError:org/springframework/transaction/interceptor/TransactionAspectSupport

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

问题处理链接如下:

java.lang.NoClassDefFoundError:org/springframework/transaction/interceptor/TransactionAspectSupport_l1994m的博客-CSDN博客

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序员lm

感谢您的支持,后续分享更多知识

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值