Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-5803

Custom Key Results in ClassCastException in CacheLoader

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 8.0.1.Final
    • JCache
    • None

    Description

      If a a JCache is created using a read-through javax.cache.integration.CacheLoader using a custom Serializable key (in this case acme.MyCache$MyKey) a ClassCastException is thrown when trying to pass the key value of org.infinispan.marshall.core.MarshalledValue instead of MarshalledValue#get() into the CacheLoader instance.

      java.lang.ClassCastException: org.infinispan.marshall.core.MarshalledValue cannot be cast to acme.MyCache$MyKey
      	at acme.MyCache$2.load(MyCache.java:1) [my-app-1.0.0-SNAPSHOT.jar:]
      	at org.infinispan.jcache.embedded.JCacheLoaderAdapter.loadKey(JCacheLoaderAdapter.java:65) [infinispan-jcache-8.0.1.Final.jar:8.0.1.Final]
      

      Attachments

        Activity

          People

            rh-ee-galder Galder ZamarreƱo
            dansiviter Daniel Siviter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: