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.

[question] Not a managed type

See original GitHub issue

Hello!

Just stumbled upon your project and it looks quite interesting, however, I’m having a hard time wrapping my head around it. Please, help!

I use spring-data-jpa in my project and everything worked without a glitch before I’ve added blaze-persistence… My entities have UUID PK and while constructing CriteriaBuilderFactory

    @Bean
    @Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
    @Lazy(false)
    public CriteriaBuilderFactory createCriteriaBuilderFactory() {
        CriteriaBuilderConfiguration config = Criteria.getDefault();
        return config.createCriteriaBuilderFactory(entityManagerFactory);
    }

I end up with exception:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.blazebit.persistence.CriteriaBuilderFactory]: Factory method 'createCriteriaBuilderFactory' threw exception; nested exception is java.lang.IllegalArgumentException: Not a managed type: class java.util.UUID
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
	... 44 common frames omitted
Caused by: java.lang.IllegalArgumentException: Not a managed type: class java.util.UUID
	at org.hibernate.jpa.internal.metamodel.MetamodelImpl.managedType(MetamodelImpl.java:210) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]

Please advise how to overcome this issue!

Thanks in advance, Andrey

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:32 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
beikovcommented, Aug 2, 2017

Thanks 😃 I talked to Markus Winand(author of the article) a few weeks ago, and figured out, that the chosen keyset pagination strategy is not yet perfect, but that will change in the final 1.2.0 version: https://github.com/Blazebit/blaze-persistence/issues/419

1reaction
beikovcommented, Aug 3, 2017

f you look into the core documentation there is something called implicit group by generation which is what is causing the group by being generated. This is a post step that just makes your life easier. If you want to have custom grouping or having predicates you can simply add them, on top of that, the rest of the needed group bys is added, skipping duplicates. It is by design that having is only allowed when specifying an explicit group by. Note that you don’t have the specify the full group by, just the item Id is enough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring boot - Not a managed type - Stack Overflow
If you are adding the spring boot module as a dependency in another project, make sure that the main class is not involved...
Read more >
How to Fix Error "Not a managed type" in Spring - YouTube
How to fix the error: java.lang.IllegalArgumentException: Not a managed type : class com.company.EntityName you may encounter during ...
Read more >
Spring Data fails with "IllegalArgumentException: Not ... - GitHub
IllegalArgumentException : Not a managed type: class com.xx.xx.model. ... unzip or git clone, build, and deploy) that reproduces the problem.
Read more >
Java – Autowiring fails: Not an managed Type - iTecNote
"Not a managed bean" means not a type the JPA provider is aware of. If you're setting up a Spring based JPA application...
Read more >
spring-projects/spring-boot - Gitter
IllegalArgumentException : Not an managed type: class com.thing.model. ... have multiple solutions for the same problem (accessing configuration properties).
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