Uploaded image for project: 'Mule'
  1. Mule
  2. MULE-13853

MetadataKey Serializer brokes with MetadataKeys with more than two levels

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.x-development
    • Fix Version/s: 4.0.0
    • Component/s: sdk
    • Labels:
    • Severity:
      S1
    • Story Points:
      3
    • Sprint:
      SDK GA Joker

      Description

      MetadataKey Serializer brokes with MetadataKeys with more than two levels

      • The¬†MetadataKeyTypeAdapter is not reusing correctly the gson instance and looses the capability of¬†deserialize correctly child keys.
      java.lang.RuntimeException: Unable to invoke no-args constructor for interface org.mule.runtime.api.metadata.MetadataKey. Register an InstanceCreator with Gson for this type may fix this problem.
      
      	at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:226)
      	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:206)
      	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
      	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
      	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
      	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
      	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
      	at com.google.gson.Gson.fromJson(Gson.java:879)
      	at com.google.gson.Gson.fromJson(Gson.java:944)
      	at com.google.gson.Gson.fromJson(Gson.java:917)
      	at org.mule.runtime.extension.internal.persistence.metadata.MetadataKeyTypeAdapter.lambda$read$0(MetadataKeyTypeAdapter.java:68)
      	at java.lang.Iterable.forEach(Iterable.java:75)
      	at org.mule.runtime.extension.internal.persistence.metadata.MetadataKeyTypeAdapter.read(MetadataKeyTypeAdapter.java:68)
      	at org.mule.runtime.extension.internal.persistence.metadata.MetadataKeyTypeAdapter.read(MetadataKeyTypeAdapter.java:26)
      	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
      	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
      	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
      	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
      	at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:187)
      	at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145)
      	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
      	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
      	at com.google.gson.Gson.fromJson(Gson.java:879)
      	at com.google.gson.Gson.fromJson(Gson.java:844)
      	at com.google.gson.Gson.fromJson(Gson.java:793)
      	at org.mule.runtime.extension.api.persistence.metadata.MetadataKeysResultJsonSerializer.deserialize(MetadataKeysResultJsonSerializer.java:53)
      	at org.mule.runtime.extension.api.persistence.MetadataKeyResultPersistenceTestCase.test(MetadataKeyResultPersistenceTestCase.java:86)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
      	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
      Caused by: java.lang.reflect.InvocationTargetException
      	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.google.gson.internal.UnsafeAllocator$1.newInstance(UnsafeAllocator.java:48)
      	at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:223)
      	... 49 more
      Caused by: java.lang.InstantiationException: org.mule.runtime.api.metadata.MetadataKey
      	at sun.misc.Unsafe.allocateInstance(Native Method)
      	... 54 more

        Attachments

          Activity

            People

            • Assignee:
              esteban.wasinger Esteban Wasinger
              Reporter:
              esteban.wasinger Esteban Wasinger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support

                  Backbone Issue Sync

                  • It looks like Backbone Issue Sync is not enabled for your project.