aileftech / snap-admin

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

Fix ClassLoader interaction with Spring Boot Devtools #8

Closed aileftech closed 11 months ago

aileftech commented 11 months 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 11 months 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 11 months ago

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