jpa:repositories changes @Repository objects into proxies. Autowiring fails [DATAJPA-112] #538
Comments
Oliver Drotbohm commented I inclined to close this one as works as designed for the following reason: the Javadoc of |
Adrian commented Sorry for answering so late. I didn't get any notification about your comment. I think my test case does not demonstrate the true problem here. Please add @Autowired
private SelectModule selectModule; to the JpaTest class and the test case will not even start due to "Injection of autowired dependencies failed". IMHO adding jpa:repositories to your context should not break the whole DI of your application. |
Oliver Drotbohm commented We'll that doesn't really add any new aspects to the problem as your still using a class without an interface unless I am not entirely getting you. |
Adrian commented I don't want to argue here. I think that the jpa module simply changes the behavior of the DI with I can work around this problem, so you can close it if you want |
Adrian opened DATAJPA-112 and commented
When activating jpa:repositories in the context the
@Repository
annotated objects get somehow proxied and spring is unable to autowire them.Please have a look at the demo project attached. There you will find a failing test.
If you change the
@Repository
annotation of the SelectModule class into@Component
the testcase is working. It is also working if you remove jpa:repositores from the text-context.xml.Affects: 1.1 M1
Attachments:
Issue Links:
DATAJPA-330
@EnableJpaRepositories
activates exception translation for@Repository
classes not in basePackagesDATACMNS-318 Introduce dedicated annotation to enable exception translation
The text was updated successfully, but these errors were encountered: