簡體   English   中英

Spring 沒有為 @service 注釋的 class 創建 bean,當它的方法之一用 @transactional 注釋時

[英]Spring is not creating the bean for @service annotated class when one of its method is annotated with @transactional

spring 應用程序無法啟動,因為它無法為 class 找到一個 bean,該 bean 使用 @Service 注釋以在配置 class 中自動裝配。 但它僅在我使用 @Transactional 注釋特定服務 class 中的方法時發生。 為什么會這樣?

While you annotate your class by @Transactional spring use AOP and if your class is final and has no interfaces it cannot create a proxy on your class.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM