Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type name to AbstractRepositoryMetadata verification exception message #3091

Closed
wants to merge 2 commits into from

Conversation

kgignatyev
Copy link
Contributor

@kgignatyev kgignatyev commented May 6, 2024

Adding type info in the error message for easier troubleshooting. Got the error

java.lang.IllegalArgumentException: Given type must be an interface
	at org.springframework.util.Assert.isTrue(Assert.java:111)
	at org.springframework.data.repository.core.support.AbstractRepositoryMetadata.<init>(AbstractRepositoryMetadata.java:59)
	at org.springframework.data.repository.core.support.DefaultRepositoryMetadata.<init>(DefaultRepositoryMetadata.java:51)
	at org.springframework.data.repository.core.support.AbstractRepositoryMetadata.getMetadata(AbstractRepositoryMetadata.java:77)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.tryAdvance(AbstractList.java:708)

for the declaration (Kotlin)

@Service
@Transactional
class LitterBizSvc(val litterCollectionRepo: LitterCollectionRepo,
    val eventPub:ApplicationEventPublisher): CrudRepository<LitterCollection, String> by litterCollectionRepo {

@pivotal-cla
Copy link

@kgignatyev Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 6, 2024
@pivotal-cla
Copy link

@kgignatyev Thank you for signing the Contributor License Agreement!

@mp911de mp911de self-assigned this May 13, 2024
@mp911de mp911de changed the title added type name to the error message Add type name to AbstractRepositoryMetadata verification error message May 14, 2024
@mp911de mp911de changed the title Add type name to AbstractRepositoryMetadata verification error message Add type name to AbstractRepositoryMetadata verification exception message May 14, 2024
@mp911de mp911de changed the title Add type name to AbstractRepositoryMetadata verification exception message Add type name to AbstractRepositoryMetadata verification exception message May 14, 2024
mp911de pushed a commit that referenced this pull request May 14, 2024
mp911de added a commit that referenced this pull request May 14, 2024
Defer message creation. Add test.

See #3091
mp911de pushed a commit that referenced this pull request May 14, 2024
mp911de added a commit that referenced this pull request May 14, 2024
Defer message creation. Add test.

See #3091
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels May 14, 2024
@mp911de mp911de added this to the 3.1.12 (2023.0.12) milestone May 14, 2024
@mp911de
Copy link
Member

mp911de commented May 14, 2024

Thank you for your contribution. That's merged, polished, and backported now.

@mp911de mp911de closed this May 14, 2024
mp911de pushed a commit that referenced this pull request Jun 10, 2024
mp911de added a commit that referenced this pull request Jun 10, 2024
Defer message creation. Add test.

See #3091
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants