xmolecules / jmolecules-integrations

Technology integration for jMolecules
Apache License 2.0
85 stars 23 forks source link

Only one repository implementation rewritten with Byte Buddy when using the Spring/JPA integration #159

Closed larsw closed 10 months ago

larsw commented 1 year ago

Hi,

I'm playing with jmolecules-ddd and the integrations for Spring and JPA.

If I declare a single aggregate root (deriving from AggregateRoot<T,TId>) and a corresponding repository implementing the CrudRepository<T,TId> everything works as expected, but when I create another aggregate root, and a repository for it, it fails when I try to do a ctx.getBean(RepoType::class.java)

Error creating bean with name 'profiles' defined in xxx.Profiles defined in @EnableJpaRepositories declared on TheApplication: Not a managed type: class xxx.Profile

What's even weirder, is that if I change the order of the two repositories in the code (just a small PoC done in a single Kotlin file), it will fail on the other repository instead.

odrotbohm commented 1 year ago

Hard to tell what's going wrong without seeing more details, especially about the aggregates. Do you have a reproducer to share? The output of the build processing the types would be interesting as well. The ordering issue is kind of explainable as Spring will process the repositories in some order and whichever repository it sees first might cause the abortion of the bootstrap. I guess none of your classes actually get processed. But it's hard to tell why.

odrotbohm commented 10 months ago

Closing this due to the lack of feedback for quite some time. Feel free to reopen with more information.