0

Error while running com.processors.d task. Cause: java.lang.ClassCastException com.person.PersonAction cannot be cast to com.person.PersonAction

When a reload happens, the PersonAction class is loaded again but the cache element value (PersonAction) in the cache remains the same resulting in the exception.

Guillaume Barré
  • 4,168
  • 2
  • 27
  • 50
Aravind
  • 73
  • 2
  • 6
  • There could be a problem of different versions of the class `PersonAction`, did you change the code recently and are you using any persistence? – fustaki Feb 21 '17 at 12:01
  • No. I can clearly see that the class loader of PersonAction class after the reload is different from the one stored in cache. – Aravind Feb 21 '17 at 12:08
  • Please add information about the environment in which the application runs. App server? OSGi? other? Also add the Ehcache version and configuration. – Louis Jacomet Feb 22 '17 at 12:29
  • It runs in a OSGi environment.. Ehcache version: 2.10.1.0_78 cache is eternal. – Aravind Feb 22 '17 at 13:05
  • What do you mean by reload? You mean the module containing the PersonAction was reloaded? – Henri Feb 22 '17 at 18:33
  • I think this is a duplicate question: http://stackoverflow.com/questions/34577936/spring-boot-devtools-causing-classcastexception-while-getting-from-cache – Gerardo Villeda Mar 22 '17 at 14:57

0 Answers0