惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
C
Cisco Blogs
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
AI
AI
P
Proofpoint News Feed
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
Webroot Blog
Webroot Blog
月光博客
月光博客
Simon Willison's Weblog
Simon Willison's Weblog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
C
CERT Recently Published Vulnerability Notes
www.infosecurity-magazine.com
www.infosecurity-magazine.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
罗磊的独立博客
D
DataBreaches.Net
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Heimdal Security Blog
S
Security @ Cisco Blogs
S
Securelist
M
MIT News - Artificial intelligence
Recorded Future
Recorded Future
Project Zero
Project Zero
K
Kaspersky official blog
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
Apple Machine Learning Research
Apple Machine Learning Research
P
Privacy International News Feed
小众软件
小众软件
T
Tor Project blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
F
Full Disclosure
P
Palo Alto Networks Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 最新话题
V
Vulnerabilities – Threatpost
博客园 - Franky
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
T
Troy Hunt's Blog
V
Visual Studio Blog

博客园 - 岁月无声

那就开始吧---写在2014年8月 基于CXF Java 搭建Web Service (Restful Web Service与基于SOAP的Web Service混合方案) 从操作系统机制浅谈服务器及服务平台方案的选择 Node.JS平台上的数据库Redis,MongoDB,HBASE,MySQL Node.JS 模块,包管理与开发 Node.JS进行简单新技术分析及环境搭建 MongoDB (1)---复制集与sharding安装配置 MongoDB (5)---不仅仅是数据库 MongoDB (0)---写在前面 NoSQL--MongoDB选择 云平台综述 物联网(1)----手机NFC识别方案平台 快速建立一个手机网站 基于HTML5手机技术方案(如Phonegap)的调试方案 由NodeJS浅谈无敌的前端开发工程师 PHP调试环境 大话网站---从Hello World到高并发网站 浅谈预演框架选择 最后的绝唱-----Symbian 最新的IDE开发环境搭建(Updated on 2011-03-07)
Spring Boot(3)---自定义spring boot starter 问题
岁月无声 · 2016-10-12 · via 博客园 - 岁月无声

1. "Failed to process import candidates for configuration class [com.simple.....]":

主要原因:

是因为自己定制的starter在打包时(package)用了spring-boot-maven-plugin,即在你的定制starter工程的pom.xml中有如下配置:

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

这样打出的包,就是按着spring boot的打包方式,Classpath设定,相对目录,资源目录等。当你用另一个spring boot项目使用这个定制的starter的jar包时。就会有问题 ,因为认为你这个starter是一个普通的jar包。

这样就无法找到你的类定义。

解决办法:

删除自定义starter中的pom.xml中的打包插件设置,采用缺省的jar打包方式。即可解决这个问题。

2.java.lang.IllegalArgumentException: Not an managed type: class .... ”

根本原因:

是你用到的一些JPA,实体,及Repository类不是你spring boot启动文件所在的目录。导致JPA搜不到这些实体,Repository类。

解决办法:

在spring boot 的启动类中加入如下注解:

@EnableJpaRepositories("com.example.repository")//那些搜索不到的JPA相关的实体及Repository的包路径

@EntityScan("com.example.repository")

如果你用到了mongo的JPA还应该加上相对应的。

@EnableMongoRepositories("com.example.mongo")
@EnableJpaRepositories("com.example.repository")

@EntityScan("com.example.repository")