aileftech / snap-admin

A plug-and-play, auto-generated CRUD database admin panel for Spring Boot apps
MIT License
262 stars 20 forks source link

Fix ClassLoader interaction with Spring Boot Devtools #8

Closed aileftech closed 1 year ago

aileftech commented 1 year ago

If devtools are included in the project, they inject a custom ClassLoader that interferes with the correct initialization of the EntityManager (see #1).

The current solution is not to include Spring Boot Devtools in order to run the project. Check what would be needed to fix this issue and restore compatibility with devtools.

odrotbohm commented 1 year ago

I think the only thing you need to do to fix this is telling Devtools, that it should include your JAR with the class loader that loads application classes by adding a META-INF/spring-devtools.properties. A project that needed to do something similar can be found here.

aileftech commented 1 year ago

Thanks! I've just tested this and it works perfectly. I'll include it in the next release.