java.lang.IllegalArgumentException: Multiple entries with the same key[connection]

MuleSoft JIRA | Pablo Cabrera | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When building an extension that has 2 or more connection providers with no XML annotation the error shown is useless since it doesn't tell you what were the error is, nor how to solve it. The error should tell you the name of the classes that generated the conflict and suggest to use the @org.mule.runtime.extension.api.annotation.Alias annotation. {code:java} [ERROR] diagnostic: error: Multiple entries with the same key[connection] java.lang.IllegalArgumentException: Multiple entries with the same key[connection] at org.mule.runtime.extension.api.introspection.AbstractComplexModel.toMap(AbstractComplexModel.java:132) at org.mule.runtime.extension.api.introspection.AbstractComplexModel.<init>(AbstractComplexModel.java:48) at org.mule.runtime.extension.api.introspection.ImmutableExtensionModel.<init>(ImmutableExtensionModel.java:58) at org.mule.runtime.extension.api.introspection.ImmutableRuntimeExtensionModel.<init>(ImmutableRuntimeExtensionModel.java:60) at org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory$FactoryDelegate.toExtension(DefaultExtensionFactory.java:148) at org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory$FactoryDelegate.access$100(DefaultExtensionFactory.java:130) at org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory.createFrom(DefaultExtensionFactory.java:124) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.parseExtension(ExtensionResourcesGeneratorAnnotationProcessor.java:107) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$null$0(ExtensionResourcesGeneratorAnnotationProcessor.java:82) at org.mule.runtime.core.util.ClassUtils.lambda$withContextClassLoader$10(ClassUtils.java:1240) at org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1219) at org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1239) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$process$1(ExtensionResourcesGeneratorAnnotationProcessor.java:81) at java.util.Optional.ifPresent(Optional.java:159) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.process(ExtensionResourcesGeneratorAnnotationProcessor.java:79) at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705) at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91) at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856) at com.sun.tools.javac.main.Main.compile(Main.java:523) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.executeWithExceptionsHandled(AbstractAnnotationProcessorMojo.java:545) at org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.execute(AbstractAnnotationProcessorMojo.java:285) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 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:497) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) {code}

    MuleSoft JIRA | 8 months ago | Pablo Cabrera
    java.lang.IllegalArgumentException: Multiple entries with the same key[connection]
  2. 0

    When building an extension that has 2 or more connection providers with no XML annotation the error shown is useless since it doesn't tell you what were the error is, nor how to solve it. The error should tell you the name of the classes that generated the conflict and suggest to use the @org.mule.runtime.extension.api.annotation.Alias annotation. {code:java} [ERROR] diagnostic: error: Multiple entries with the same key[connection] java.lang.IllegalArgumentException: Multiple entries with the same key[connection] at org.mule.runtime.extension.api.introspection.AbstractComplexModel.toMap(AbstractComplexModel.java:132) at org.mule.runtime.extension.api.introspection.AbstractComplexModel.<init>(AbstractComplexModel.java:48) at org.mule.runtime.extension.api.introspection.ImmutableExtensionModel.<init>(ImmutableExtensionModel.java:58) at org.mule.runtime.extension.api.introspection.ImmutableRuntimeExtensionModel.<init>(ImmutableRuntimeExtensionModel.java:60) at org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory$FactoryDelegate.toExtension(DefaultExtensionFactory.java:148) at org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory$FactoryDelegate.access$100(DefaultExtensionFactory.java:130) at org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory.createFrom(DefaultExtensionFactory.java:124) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.parseExtension(ExtensionResourcesGeneratorAnnotationProcessor.java:107) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$null$0(ExtensionResourcesGeneratorAnnotationProcessor.java:82) at org.mule.runtime.core.util.ClassUtils.lambda$withContextClassLoader$10(ClassUtils.java:1240) at org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1219) at org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1239) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$process$1(ExtensionResourcesGeneratorAnnotationProcessor.java:81) at java.util.Optional.ifPresent(Optional.java:159) at org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.process(ExtensionResourcesGeneratorAnnotationProcessor.java:79) at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705) at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91) at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856) at com.sun.tools.javac.main.Main.compile(Main.java:523) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.executeWithExceptionsHandled(AbstractAnnotationProcessorMojo.java:545) at org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.execute(AbstractAnnotationProcessorMojo.java:285) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 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:497) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) {code}

    MuleSoft JIRA | 8 months ago | Pablo Cabrera
    java.lang.IllegalArgumentException: Multiple entries with the same key[connection]

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Multiple entries with the same key[connection]

      at org.mule.runtime.extension.api.introspection.AbstractComplexModel.toMap()
    2. org.mule.runtime
      ExtensionResourcesGeneratorAnnotationProcessor.lambda$process$1
      1. org.mule.runtime.extension.api.introspection.AbstractComplexModel.toMap(AbstractComplexModel.java:132)
      2. org.mule.runtime.extension.api.introspection.AbstractComplexModel.<init>(AbstractComplexModel.java:48)
      3. org.mule.runtime.extension.api.introspection.ImmutableExtensionModel.<init>(ImmutableExtensionModel.java:58)
      4. org.mule.runtime.extension.api.introspection.ImmutableRuntimeExtensionModel.<init>(ImmutableRuntimeExtensionModel.java:60)
      5. org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory$FactoryDelegate.toExtension(DefaultExtensionFactory.java:148)
      6. org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory$FactoryDelegate.access$100(DefaultExtensionFactory.java:130)
      7. org.mule.runtime.module.extension.internal.introspection.DefaultExtensionFactory.createFrom(DefaultExtensionFactory.java:124)
      8. org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.parseExtension(ExtensionResourcesGeneratorAnnotationProcessor.java:107)
      9. org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$null$0(ExtensionResourcesGeneratorAnnotationProcessor.java:82)
      10. org.mule.runtime.core.util.ClassUtils.lambda$withContextClassLoader$10(ClassUtils.java:1240)
      11. org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1219)
      12. org.mule.runtime.core.util.ClassUtils.withContextClassLoader(ClassUtils.java:1239)
      13. org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.lambda$process$1(ExtensionResourcesGeneratorAnnotationProcessor.java:81)
      13 frames
    3. Java RT
      Optional.ifPresent
      1. java.util.Optional.ifPresent(Optional.java:159)
      1 frame
    4. org.mule.runtime
      ExtensionResourcesGeneratorAnnotationProcessor.process
      1. org.mule.runtime.module.extension.internal.resources.ExtensionResourcesGeneratorAnnotationProcessor.process(ExtensionResourcesGeneratorAnnotationProcessor.java:79)
      1 frame
    5. Java Tools
      JavacTaskImpl.call
      1. com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
      2. com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
      3. com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
      4. com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
      5. com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
      6. com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
      7. com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
      8. com.sun.tools.javac.main.Main.compile(Main.java:523)
      9. com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
      10. com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
      10 frames
    6. org.bsc.maven
      AbstractAnnotationProcessorMojo.execute
      1. org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.executeWithExceptionsHandled(AbstractAnnotationProcessorMojo.java:545)
      2. org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.execute(AbstractAnnotationProcessorMojo.java:285)
      2 frames
    7. Maven Plugin
      DefaultBuildPluginManager.executeMojo
      1. org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      1 frame
    8. Maven Core
      DefaultMaven.execute
      1. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      2. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      3. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      4. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      5. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      6. org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      7. org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      8. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      9. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      10. org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      10 frames
    9. M3 Interceptor
      MavenCli.main
      1. org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
      2. org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
      3. org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
      3 frames
    10. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    11. Plexus
      Launcher.main
      1. org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      2. org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      3. org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      4. org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      4 frames