question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Moduliths Events JPA module not working properly when used with Spring Boot DevTools

See original GitHub issue

Parameter 0 of constructor in org.moduliths.events.jpa.JpaEventPublicationConfiguration required a bean of type ‘org.moduliths.events.jpa.JpaEventPublicationRepository’ that could not be found.

Spring Boot Version 2.4.4, Also tried downgrading to 2.3.10 with no luck.

The following issue solution did not help either: Upgrading to 1.1.0-RC2 solved the issue.

_Originally posted by @igler in https://github.com/odrotbohm/moduliths/issues/166#issuecomment-818947681_

Getting this with all versions of the library when starting my application. Any assistance would be greatly appreciated @odrotbohm

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
odrotbohmcommented, May 5, 2021

I’ve fixed the issue with DevTools. If you’re not using automatic schema creation with Hibernate, you’d have to take care of the schema creation for the publication table yourself. I guess you can mimic what Hibernate is doing, enable SQL logging in a sample project and just copy the output into a Flyway script or the like for now. I’d like to focus this ticket on the DevTools aspect and mark this resolved. We of course need to improve on the schema creation but that’s likely much more effort as we have to provide this for multiple databases etc., which warrants a new ticket.

Regarding the actual interaction with the database, I’d have to again ask for a reproducing example as “nothing is ever being persisted” can’t really be investigated without one and we have tests and samples (one linked to above), that actually show the interaction happening and the log working.

1reaction
odrotbohmcommented, May 4, 2021

Let’s tackle this, one by one: if you use @EnableJpaRepositories explicitly, you completely disable Boot’s auto-configuration for JPA and Spring Data JPA repositories. That means that repositories and entities are only picked up from packages you define. Can you try adding org.moduliths.events.jpa to the list of packages you declare explicitly?

Regarding the “non-public interface is not defined by the given loader” I’ll have to investigate. Is DevTools in play here by accident? I’ve experienced the classloader arrangement causing a few issues here and there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Moduliths Events JPA module not working properly ... - GitHub
I just checked the setup of the auto-configuration we deploy here: it assumes – if you use Spring Boot – that Spring Data...
Read more >
spring boot app does not reload despite spring boot dev tools ...
have you tried this command in application.properties: spring.devtools.livereload.enabled=true. check this resource:
Read more >
DevTools in Spring Boot 1.3
The aim of this module is to try and improve the development-time experience when working on Spring Boot applications. To use the module...
Read more >
Overview of Spring Boot Dev Tools - Baeldung
This article will try to cover the benefits we can achieve using the new functionality. We'll cover the following topics: Property defaults ...
Read more >
Salespoint Framework Changelog
#363 - Upgrade to Moduliths 1.2.1. #362 - Upgrade to Spring Boot 2.5.5. #356 - Upgrade Asciidoctor Maven Plugin to 2.2.1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found