一、问题描述

在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问题解决相关推荐

  1. 神秘又强大的@SpringBootApplication注解

    作者:vivo 互联网服务器团队-Peng peng 一.前言 大部分的配置都可以用Java类+注解来代替,而在SpringBoot项目中见的最多的莫过于@SpringBootApplication注 ...

  2. springboot情操陶冶-@SpringBootApplication注解解析

    承接前文springboot情操陶冶-@Configuration注解解析,本文将在前文的基础上对@SpringBootApplication注解作下简单的分析 @SpringBootApplicat ...

  3. 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 声 ...

  4. 转载 loadrunner的一些问题解决

    sckOutOfMemory 7 内存不足  sckInvalidPropertyValue 380 属性值不效  sckGetNotSupported 394 属性不可读  sckGetNotSup ...

  5. No qualifying bean of type问题解决

    No qualifying bean of type问题解决 前言 No qualifying bean of type 'xxx.xxx.xxx' available: expected singl ...

  6. springboot源码(二)@SpringBootApplication注解中exclude参数使用及原理

    文章目录 一.使用姿势 二.运行原理 上篇文章中, <springboot源码(一)启动流程+自动配置原理分析>,简单分析了启动流程,其中涉及到了@SpringBootApplicatio ...

  7. 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 ...

  8. 解决<tx:attributes>标红,元素tx:attributes不允许在这里

    初学ssm时,在applicationContext.xml中配置事务增强时,<tx:attributes>标签标红 解决办法:更改bean的引用约束 xmlns:tx="htt ...

  9. Oracle 常见错误总结(如:ORA-XXXXX)及问题解决方法

    转: Oracle 常见错误总结(如:ORA-XXXXX)及问题解决方法 ORA-00001: 违反唯一约束条件 ORA-00017: 请求会话以设置跟踪事件 ORA-00018: 超出最大会话数 O ...

最新文章

  1. 【Zookeeper系列】ZooKeeper管理分布式环境中的数据(转)
  2. 如何让FPGA中的SPI与其他模块互动起来
  3. 高翔orbslam_高翔博士分享ORBSLAM2_with_pointcloud_map的安装步骤
  4. 上云的先行军,QQ 率先完成了20万台服务器全量上云,是怎么做到的?
  5. 我的一些学习经验:ONVIF
  6. Preferences偏好设置
  7. 用几个最简单的例子带你入门 Python 爬虫
  8. XYGame-AI设计3-行为树-第1版本
  9. 从零实现爬虫和情感分类模型(二)
  10. 【能量检测】基于认知无线电的能量检测算法的matlab仿真
  11. 将新项目上传到svn
  12. 渗透技巧总结、渗透技巧
  13. page fault
  14. 字节、快手、天弘基金等 :量化/算法工程师岗位【社招|校招|实习生】
  15. 蛮好用的Gungho重点工作督查督办跟踪管理系统
  16. 双色汉诺塔算法的证明——数学归纳法
  17. [Python3]pandas.merge用法详解
  18. 【Linux】chmod、chown、chgrp区别和使用
  19. 登录可以用微信的163邮箱!TOM VIP商务邮全新而来!
  20. web课程设计网页规划与设计:摄影/拍摄/相片网站设计——摄影网(12页)HTML+CSS+JavaScript div+css网页html成品学生作业

热门文章

  1. HEVC码率控制代码分析
  2. 如何做一个真正的男人
  3. 辉芒微IO单片机FT60F112
  4. ansys apdl变量基本操作
  5. Processing基本函数整理
  6. 何恺明目前的学术成果是否够得上计算机视觉领域历史第一人?
  7. C#:什么是委托和事件及其相关(转)
  8. python 字节流分段_如何在Python中编写简单代码,并且速度超越Spark?
  9. 机器人与视觉——李群与李代数,李括号性质的分析与证明
  10. 众里寻它千百度,原来它在...MSDN处