Attributes should be specified via @SpringBootApplication问题解决
一、问题描述
在spring boot启动方法上设置@EnableAutoConfiguration注解,如下所示:
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;@SpringBootApplication
@EnableAutoConfiguration(exclude = {org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration.class})
@EnableScheduling
public class DPServerApplication {public static void main(String[] args) {System.setProperty("mail.mime.splitlongparameters", "false");SpringApplication.run(DPServerApplication.class, args);}
}
在idea中报如下错误:
二、分析问题
经过排查代码发现,@SpringBootApplication注解中已经包含@EnableAutoConfiguration注解,不需要重复定义@EnableAutoConfiguration注解。
三、解决方法
在spring boot启动方法上,去掉@EnableAutoConfiguration注解即可,如下所示:
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;@SpringBootApplication(exclude = {org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration.class})
@EnableScheduling
public class DPServerApplication {public static void main(String[] args) {System.setProperty("mail.mime.splitlongparameters", "false");SpringApplication.run(DPServerApplication.class, args);}
}
至此,问题解决。
Attributes should be specified via @SpringBootApplication问题解决相关推荐
- 神秘又强大的@SpringBootApplication注解
作者:vivo 互联网服务器团队-Peng peng 一.前言 大部分的配置都可以用Java类+注解来代替,而在SpringBoot项目中见的最多的莫过于@SpringBootApplication注 ...
- springboot情操陶冶-@SpringBootApplication注解解析
承接前文springboot情操陶冶-@Configuration注解解析,本文将在前文的基础上对@SpringBootApplication注解作下简单的分析 @SpringBootApplicat ...
- persistence.cpp:2197:ann.xml(1): There should be space between attributes in function icvXMLParseTag
August 3, 2016 作者:dengshuai_super 出处:http://blog.csdn.net/dengshuai_super/article/details/52069634 声 ...
- 转载 loadrunner的一些问题解决
sckOutOfMemory 7 内存不足 sckInvalidPropertyValue 380 属性值不效 sckGetNotSupported 394 属性不可读 sckGetNotSup ...
- No qualifying bean of type问题解决
No qualifying bean of type问题解决 前言 No qualifying bean of type 'xxx.xxx.xxx' available: expected singl ...
- springboot源码(二)@SpringBootApplication注解中exclude参数使用及原理
文章目录 一.使用姿势 二.运行原理 上篇文章中, <springboot源码(一)启动流程+自动配置原理分析>,简单分析了启动流程,其中涉及到了@SpringBootApplicatio ...
- centos 6下apache kudu安装报错Error during hole punch test问题解决
[环境] centos 6.8.6.9版本,x86 64位 CDH版本CDH-5.13.3-1.cdh5.13.3.p0.2 kudu版本1.5.0 [过程和报错] 通过cloudera manage ...
- 解决<tx:attributes>标红,元素tx:attributes不允许在这里
初学ssm时,在applicationContext.xml中配置事务增强时,<tx:attributes>标签标红 解决办法:更改bean的引用约束 xmlns:tx="htt ...
- Oracle 常见错误总结(如:ORA-XXXXX)及问题解决方法
转: Oracle 常见错误总结(如:ORA-XXXXX)及问题解决方法 ORA-00001: 违反唯一约束条件 ORA-00017: 请求会话以设置跟踪事件 ORA-00018: 超出最大会话数 O ...
最新文章
- 【Zookeeper系列】ZooKeeper管理分布式环境中的数据(转)
- 如何让FPGA中的SPI与其他模块互动起来
- 高翔orbslam_高翔博士分享ORBSLAM2_with_pointcloud_map的安装步骤
- 上云的先行军,QQ 率先完成了20万台服务器全量上云,是怎么做到的?
- 我的一些学习经验:ONVIF
- Preferences偏好设置
- 用几个最简单的例子带你入门 Python 爬虫
- XYGame-AI设计3-行为树-第1版本
- 从零实现爬虫和情感分类模型(二)
- 【能量检测】基于认知无线电的能量检测算法的matlab仿真
- 将新项目上传到svn
- 渗透技巧总结、渗透技巧
- page fault
- 字节、快手、天弘基金等 :量化/算法工程师岗位【社招|校招|实习生】
- 蛮好用的Gungho重点工作督查督办跟踪管理系统
- 双色汉诺塔算法的证明——数学归纳法
- [Python3]pandas.merge用法详解
- 【Linux】chmod、chown、chgrp区别和使用
- 登录可以用微信的163邮箱!TOM VIP商务邮全新而来!
- web课程设计网页规划与设计:摄影/拍摄/相片网站设计——摄影网(12页)HTML+CSS+JavaScript div+css网页html成品学生作业