Is there any way to integrate the auto-restart function of Spring boot devtools with the ActiveJDBC's instrumentation function?
There is also a need to provide instrumentation every time there is a change in the model or DB, but the code generated when there was a Auto-Restart on the devtools side of Spring boot was generated by the instrumentation on the ActiveJDBC side asynchrony with the code occurs, and even if it is the same class on the source, it will not match and will give an error that it can not be cast.
eg.
class dev.logue.sample.models.User cannot be cast to class dev.logue.sample.models.User (dev.logue.sample.models.User is in unnamed module of loader 'app'; dev.logue.sample.models.User is in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader
I'm not very familiar with Java, is there any way to synchronize this process?
My Environment:
openjdk version "11.0.6" 2020-01-14 LTS
OpenJDK Runtime Environment Zulu11.37+17-CA (build 11.0.6+10-LTS)
OpenJDK 64-Bit Server VM Zulu11.37+17-CA (build 11.0.6+10-LTS, mixed mode)
Was self resolved.
Apparently,
spring-devtools.properties
should explicitly load the class generated by ActiveJDBC.src/main/resources/META-INF/spring-devtools.properties:
The error message did not include activejdbc, so I thought it was related to the class file generated after instrumentation.
Also, just in case, model classes are omitted from Spring devtools scan path in
application.properties
.src/main/resources/application.properties: