-
Notifications
You must be signed in to change notification settings - Fork 14
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
Entity is not recognized as managed: "java.lang.IllegalArgumentException: Not a managed type" #1
Comments
Thanks for reporting this issue. I will look into it soon and keep you updated. As for Lombok, I have not yet tested it and I guess there's the possibility that sometimes it intereferes, but I don't think it's the issue here. |
I was able to reproduce the issue with version 0.1.2 but not with the latest commit version. I've released 0.1.3 on Maven and it should be available in a few hours (or you can clone the repo). As I am not sure about the cause of the issue yet, please let me know if still persists on your end. |
I get the same problem with 0.1.3. My entity setup is really simple:
No lombok is involved. |
Just noticed I'm using |
Hey @agxs, thanks for chiming in! Using an unsupported type should result in an error at startup, like the following:
Since this is not happening it means the "Not a managed type" error occurs earlier and is not related to the Could you tell me what is your data source and how it's configured? PS: I can look into adding |
In particuar, could anybody who is getting this error look at the application.properties file for the test project and see if there's any possibly relevant difference, particularly in regarding the way the data source is set up? |
Not sure the above is relevant after following through other sections of the code :( |
Thanks for the quick response @aileftech . My
|
I think I have found the issue, or at least I have an idea on how to investigate. Could you please add the property:
and see if it runs? The difference is that it will use an in-memory database for the internal storage, so it will not persist across restarts. A problem occurs when the persistent data source is used instead, if my intuition is correct. In any case I am able to reproduce the issue now with the latest version as well so I'll be working on it. |
Upon further inspection, this seems to have nothing to do with Could this be the ClassLoader related issue you where mentioning? Not asking rethorically, I don't know much about that. |
I believe I have finally solved this issue. The problem is the inclusion of spring-boot-devtools I had in my In any case, the solution for now is to not include devtools. I've removed it from my If anybody can confirm this solves the issue it would be great. I'll open another issue in order to see if I can work around this problem and make the project work with Devtools as well. |
I have released a fixed |
I just saw your #8 issue and remembered I have the Spring DevTools artifect loaded in my project. Removing this dependency worked (Well, now I get the error about EDIT - ah yes, just noticed your update above, my browser tab hadn't updated when I added this comment. |
Thank you so much! I'm glad it works now, as this one was a bit tricky to debug (GPT4 has been very useful to troubleshoot with). I'm already working on |
Hello, I'm getting a java.lang.IllegalArgumentException: Not a managed type: class com.grokthecode.damcheck.entities.DamEntity Exception for a entity named DamEntity, but it does have the @entity annotation.
Here is the relevant stack trace:
And here is the partial code for the entity:
I am using Lombok, maybe that's causing noise?
I'm using Spring boot 3.1.4, Amazon Correto JDK 17 and spring-boot-database-admin 0.1.2
Thank you.
The text was updated successfully, but these errors were encountered: