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

Missing transcoder for user marshaller's media type

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 11.0.0.Dev05
    • Fix Version/s: 11.0.0.Final
    • Component/s: Core
    • Labels:
      None

      Description

      When the user configures a custom marshaller like JavaSerializationMarshaller, the cache needs a transcoder to wrap the user marshaller and convert between Java objects and the storage media type. Of course, if the cache's storage media type is not the same as the user marshaller's media type, another transcoder will be used, but the user marshaller transcoder needs to be available.

      Currently EncoderRegistryFactory registers a transcoder wrapping the global marshaller instead, and the cache won't start:

            GlobalConfigurationBuilder gcb = new GlobalConfigurationBuilder();
            gcb.serialization().marshaller(new JavaSerializationMarshaller());
            DefaultCacheManager manager = new DefaultCacheManager(gcb.build());
      
            ConfigurationBuilder builder = new ConfigurationBuilder();
            builder.encoding().mediaType(MediaType.APPLICATION_SERIALIZED_OBJECT_TYPE);
            manager.createCache("cache", builder.build());
      
      org.infinispan.commons.CacheConfigurationException: Unable to inject dependencies for component class org.infinispan.encoding.DataConversion, path org.infinispan.AdvancedCache (a org.infinispan.cache.impl.EncoderCache)
      Caused by: org.infinispan.commons.dataconversion.EncodingException: ISPN000492: Cannot find transcoder between 'application/x-java-object' to 'application/x-java-serialized-object'
      	at org.infinispan.marshall.core.EncoderRegistryImpl.getTranscoder(EncoderRegistryImpl.java:64)
      	at org.infinispan.encoding.DataConversion.lookupTranscoder(DataConversion.java:210)
      	at org.infinispan.encoding.DataConversion.injectDependencies(DataConversion.java:185)
      	at org.infinispan.encoding.CorePackageImpl$1.wire(CorePackageImpl.java:29)
      	at org.infinispan.encoding.CorePackageImpl$1.wire(CorePackageImpl.java:27)
      	at org.infinispan.factories.impl.BasicComponentRegistryImpl.invokeInjection(BasicComponentRegistryImpl.java:339)
      	... 45 more
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                dan.berindei Dan Berindei
                Reporter:
                dan.berindei Dan Berindei
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: