当前位置:网站首页>Unable to use the bean introduced into the jar package
Unable to use the bean introduced into the jar package
2022-06-24 22:29:00 【follow_ me!】
problem :
stay A Project use @[email protected]、@Component、@Service、@Controller、@Mapper、@Repository And other annotation injected classes , Pack it up jar After the introduction of B The project cannot be used @Autowired Automatic injection
Analytical problem :
because SpringBoot The default path for automatic scanning is the package where the main startup class is located and its child packages , If jar In bag bean The path to is not included , Will not be scanned , So it can't be used @Autowired Automatic injection
resolvent :
resolvent 1:
@SpringBootApplication Set parameters :scanBasePackages={“com."}
resolvent 2: Add... On the main boot :@ComponentScan("com.”)
边栏推荐
- 磁盤的結構
- EasyBypass
- Implementation of heap sort and quick sort principle
- Servlet详解
- 直播软件app开发,左右自动滑动的轮播图广告
- 堆内存分配的并发问题
- 零代码即可将数据可视化应用到企业管理中
- Shutter precautions for using typedef
- 60 个神级 VS Code 插件!!
- Technology Review: what is the evolution route of container technology? What imagination space is there in the future?
猜你喜欢

Docker installs MySQL 8.0. Detailed steps

The process from troubleshooting to problem solving: the browser suddenly failed to access the web page, error code: 0x80004005, and the final positioning: "when the computer turns on the hotspot, the

How to refine permissions to buttons?

DX 的 HLSL 和 GL 的 GLSL的 矩阵构建的行列区别

Technology inventory: past, present and future of Message Oriented Middleware

Kubevela v1.2 release: the graphical operation console velaux you want is finally here

理想L9,智能座舱新潮流

In the first year of L2, arbitrum nitro was upgraded to bring more compatible and efficient development experience

Detailed installation and use of performance test tool wrk

Resolving the conflict problem of the flutter Library
随机推荐
MySQL gets fields and comments by indicating
磁盘的结构
产业互联网时代,并不存在传统意义上的互联网
Industrial development status of virtual human
Description of software version selection of kt6368a Bluetooth dual-mode transparent chip
Servlet详解
Disk structure
Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware
The leader of ERP software in printing industry
HTTP的缓存控制
Two implementation methods of stack
Concurrency of heap memory allocation
Embedded development: tips and tricks -- clean jump from boot loader to application code
Technology Review: what is the evolution route of container technology? What imagination space is there in the future?
Yida technology signed a contract with seven wolves to help the digital transformation of "Chinese men's wear leader"
A girl has been making hardware for ten years. 。。
系统测试主要步骤
How to extract dates from web pages?
You are using pip version 21.1.2; however, version 22.1.2 is available
华大04a工作模式/低功耗模式