当前位置:网站首页>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.”)
边栏推荐
- Resolving the conflict problem of the flutter Library
- Docker 安装 MySQL 8.0,详细步骤
- envoy获取客户端真实IP
- Flutter: Unsupported value: false/true
- DAO 中常见的投票治理方式
- OA system -- save the verification code to session
- Yida technology signed a contract with seven wolves to help the digital transformation of "Chinese men's wear leader"
- 为什么有的程序员能力一般却能拿到好offer?
- Detailed installation and use of performance test tool wrk
- ThreadLocal内存泄漏问题
猜你喜欢

NIO多路复用之Selector的使用

AQS source code analysis

网上立案流程

Cache control of HTTP

Ideal L9, new trend of intelligent cockpit

Raspberry pie preliminary use

Machine learning: linear regression

Industrial development status of virtual human

Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware

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
随机推荐
Find the maximum value in each tree row [extension of one of the hierarchical traversals]
In the first year of L2, arbitrum nitro was upgraded to bring more compatible and efficient development experience
嵌入式开发:技巧和窍门——干净地从引导加载程序跳转到应用程序代码
I really can't do it. After 00, I collapsed and wanted to leave
MySQL gets fields and comments by indicating
Redis-跳表
Why can some programmers get good offers with average ability?
Docker 安装 MySQL 8.0,详细步骤
Structure du disque
The profound meaning of unlimited ecological development in Poka -- Multidimensional Interpretation of parallel chain
理想L9,智能座舱新潮流
In the era of industrial Internet, there is no Internet in the traditional sense
NIO多路复用之Selector的使用
leetcode:45. Jumping game II [classic greed]
You are using pip version 21.1.2; however, version 22.1.2 is available
leetcode:515. 在每个树行中找最大值【无脑bfs】
Concurrency of heap memory allocation
Valueerror: cannot take a larger sample than population when 'replace=false‘
Use of selector for NiO multiplexing
DP problem set