1 Reply Latest reply on Dec 21, 2018 5:09 AM by tisaksen

    ClassCastException when using same class in io.undertow.server.HttpHandler and WebApp

    tisaksen

      I have deploy a HttpHandler which places an object "Skip"  in an Infinispan cache. I have a webapp which looks up the cached "Skip" object but I am getting the following error:

       

      org.jboss.resteasy.spi.UnhandledException: java.lang.ClassCastException: class Skip cannot be cast to class Skip (no.toyota.gatekeeper.model.Skip is in unnamed module of loader 'no.toyota.gatekeeper@2.7' @2f40315a; no.toyota.gatekeeper.model.Skip is in unnamed module of loader 'deployment.gatekeeper-1.0-SNAPSHOT.war' @7f833b70)

       

      How can I make sure no.toyota.gatekeeper.model.Skip is loaded with the same Classloader or otherwise work around this issue?