运行springboot:run报错java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

运行springboot:run报错java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy,第1张

运行springboot:run报错java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy 问题描述

用IDEA构建一个简单的微服务,用spring-boot-maven-plugin插件的run目标(goal)构建工程,报错如下:
工程的pom文件如下:



    4.0.0

    com.zswang
    license-service
    1.0-SNAPSHOT
    jar

    Eagle-eye Licensing Service
    Licensing Service

    
        org.springframework.boot
        spring-boot-starter-parent
        1.4.4.RELEASE
        
    

    
        
            org.springframework.boot
            spring-boot-starter-web
        
        
            org.springframework.boot
            spring-boot-starter-actuator
            2.0.4.RELEASE
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    


解决方法

首先观察报错内容,主要是actuate出错:
根据横云断岭这篇分析,这个错误来自于springboot2更改类名,但是我这儿用的是springboot1啊(不信你看这个工程的pom继承的pom的版本是1.4.4.RELEASE)。后来仔细一看发现,我的spring-boot-starter-actuator用的版本是2.0.4.RELEASE。原来如此,果断改成1.4.4.RELEASE,spingboot:run成功了!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/4748178.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-08
下一篇 2022-11-08

发表评论

登录后才能评论

评论列表(0条)

保存