java.lang.RuntimeException: Can not create resource releaser instance from resource: /org/mule/runtime/module/artifact/classloader/DefaultResourceReleaser.class

MuleSoft JIRA | Damian Sima | 9 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    When trying to dispose a MuleArtifactClassLoader the method #createResourceReleaserInstance fails due to a classcast exception. This seems only to fail when creating the CL loader through MuleClassLoaderFactory {code} ERROR 2016-08-29 16:25:44,121 [main] org.mule.runtime.module.artifact.classloader.MuleArtifactClassLoader: Cannot create resource releaser instance java.lang.RuntimeException: Can not create resource releaser instance from resource: /org/mule/runtime/module/artifact/classloader/DefaultResourceReleaser.class at org.mule.runtime.module.artifact.classloader.MuleArtifactClassLoader.createResourceReleaserInstance(MuleArtifactClassLoader.java:107) ~[mule-module-artifact-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at org.mule.runtime.module.artifact.classloader.MuleArtifactClassLoader.dispose(MuleArtifactClassLoader.java:86) ~[mule-module-artifact-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at org.mule.munit.classloading.manager.ClassLoaderManager.restoreCurrentThreadClassLoader(ClassLoaderManager.java:47) ~[munit-maven-plugin-2.0.0-SNAPSHOT.jar:?] at org.mule.munit.MUnitMojo.runTests(MUnitMojo.java:243) ~[munit-maven-plugin-2.0.0-SNAPSHOT.jar:?] at org.mule.munit.MUnitMojo.doExecute(MUnitMojo.java:179) ~[munit-maven-plugin-2.0.0-SNAPSHOT.jar:?] at org.mule.munit.MUnitMojo.execute(MUnitMojo.java:129) ~[munit-maven-plugin-2.0.0-SNAPSHOT.jar:?] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) ~[maven-core-3.0.5.jar:3.0.5] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) ~[maven-embedder-3.0.5.jar:3.0.5] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) ~[maven-embedder-3.0.5.jar:3.0.5] at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) ~[maven-embedder-3.0.5.jar:3.0.5] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) ~[plexus-classworlds-2.4.jar:?] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) ~[plexus-classworlds-2.4.jar:?] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) ~[plexus-classworlds-2.4.jar:?] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) ~[plexus-classworlds-2.4.jar:?] Caused by: java.lang.ClassCastException: org.mule.runtime.module.artifact.classloader.DefaultResourceReleaser cannot be cast to org.mule.runtime.module.artifact.classloader.ResourceReleaser at org.mule.runtime.module.artifact.classloader.MuleArtifactClassLoader.createResourceReleaserInstance(MuleArtifactClassLoader.java:105) ~[mule-module-artifact-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] ... 26 more {code}

    MuleSoft JIRA | 9 months ago | Damian Sima
    java.lang.RuntimeException: Can not create resource releaser instance from resource: /org/mule/runtime/module/artifact/classloader/DefaultResourceReleaser.class

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.mule.runtime.module.artifact.classloader.DefaultResourceReleaser cannot be cast to org.mule.runtime.module.artifact.classloader.ResourceReleaser

      at org.mule.runtime.module.artifact.classloader.MuleArtifactClassLoader.createResourceReleaserInstance()
    2. org.mule.runtime
      MuleArtifactClassLoader.dispose
      1. org.mule.runtime.module.artifact.classloader.MuleArtifactClassLoader.createResourceReleaserInstance(MuleArtifactClassLoader.java:105)[mule-module-artifact-4.0-SNAPSHOT.jar:4.0-SNAPSHOT]
      2. org.mule.runtime.module.artifact.classloader.MuleArtifactClassLoader.dispose(MuleArtifactClassLoader.java:86)[mule-module-artifact-4.0-SNAPSHOT.jar:4.0-SNAPSHOT]
      2 frames
    3. org.mule.munit
      MUnitMojo.execute
      1. org.mule.munit.classloading.manager.ClassLoaderManager.restoreCurrentThreadClassLoader(ClassLoaderManager.java:47)[munit-maven-plugin-2.0.0-SNAPSHOT.jar:?]
      2. org.mule.munit.MUnitMojo.runTests(MUnitMojo.java:243)[munit-maven-plugin-2.0.0-SNAPSHOT.jar:?]
      3. org.mule.munit.MUnitMojo.doExecute(MUnitMojo.java:179)[munit-maven-plugin-2.0.0-SNAPSHOT.jar:?]
      4. org.mule.munit.MUnitMojo.execute(MUnitMojo.java:129)[munit-maven-plugin-2.0.0-SNAPSHOT.jar:?]
      4 frames
    4. Maven Plugin
      DefaultBuildPluginManager.executeMojo
      1. org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)[maven-core-3.0.5.jar:3.0.5]
      1 frame
    5. Maven Core
      DefaultMaven.execute
      1. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)[maven-core-3.0.5.jar:3.0.5]
      2. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)[maven-core-3.0.5.jar:3.0.5]
      3. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)[maven-core-3.0.5.jar:3.0.5]
      4. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)[maven-core-3.0.5.jar:3.0.5]
      5. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)[maven-core-3.0.5.jar:3.0.5]
      6. org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)[maven-core-3.0.5.jar:3.0.5]
      7. org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)[maven-core-3.0.5.jar:3.0.5]
      8. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)[maven-core-3.0.5.jar:3.0.5]
      9. org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)[maven-core-3.0.5.jar:3.0.5]
      9 frames
    6. M3 Interceptor
      MavenCli.main
      1. org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)[maven-embedder-3.0.5.jar:3.0.5]
      2. org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)[maven-embedder-3.0.5.jar:3.0.5]
      3. org.apache.maven.cli.MavenCli.main(MavenCli.java:141)[maven-embedder-3.0.5.jar:3.0.5]
      3 frames
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[?:1.8.0_92]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[?:1.8.0_92]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[?:1.8.0_92]
      4. java.lang.reflect.Method.invoke(Method.java:498)[?:1.8.0_92]
      4 frames
    8. Plexus
      Launcher.main
      1. org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)[plexus-classworlds-2.4.jar:?]
      2. org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)[plexus-classworlds-2.4.jar:?]
      3. org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)[plexus-classworlds-2.4.jar:?]
      4. org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)[plexus-classworlds-2.4.jar:?]
      4 frames