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

推荐订阅源

雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
V
V2EX
Jina AI
Jina AI
S
Schneier on Security
Cyberwarzone
Cyberwarzone
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
美团技术团队
小众软件
小众软件
L
LangChain Blog
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
T
Threatpost
T
Tor Project blog
K
Kaspersky official blog
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
H
Heimdal Security Blog
N
News and Events Feed by Topic
T
Threat Research - Cisco Blogs
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
M
MIT News - Artificial intelligence
Apple Machine Learning Research
Apple Machine Learning Research
N
News | PayPal Newsroom
I
Intezer
博客园 - 聂微东
U
Unit 42
Cisco Talos Blog
Cisco Talos Blog
量子位
T
The Exploit Database - CXSecurity.com
Last Week in AI
Last Week in AI
博客园_首页
月光博客
月光博客
Webroot Blog
Webroot Blog
I
InfoQ
The Cloudflare Blog
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
Project Zero
Project Zero
Hacker News: Ask HN
Hacker News: Ask HN
IT之家
IT之家
Google DeepMind News
Google DeepMind News
C
Cisco Blogs

博客园 - 岁月无声

那就开始吧---写在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")