hudson.util.IOException2: Failed to initialize

Jenkins JIRA | Mike Dillon | 7 years ago
  1. 0

    While trying to use the Spring classes embedded into the Hudson war in a plugin, I encountered the following exception: hudson.util.IOException2: Failed to initialize at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:224) at hudson.PluginManager.<init>(PluginManager.java:156) at hudson.model.Hudson.<init>(Hudson.java:542) at hudson.WebAppMain$2.run(WebAppMain.java:191) Caused by: java.lang.NoClassDefFoundError: org/springframework/aop/TargetSource at hudson.plugins.jmx.PluginImpl.start(PluginImpl.java:29) at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:232) at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:221) ... 3 more Caused by: java.lang.ClassNotFoundException: org.springframework.aop.TargetSource at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) ... 6 more The issue is that the classes from spring-context that I am using depend on spring-aop. The spring-aop artifact is declared as optional in the spring-context POM file, so it is not bundled with the WAR. The spring-context JAR is being pulled in transitively via Hudson's dependency on spring-web. I attempted to work around this problem by adding spring-aop to the POM file for my plugin, but still saw the NoClassDefFoundError, likely because the class triggering the load of org.springframework.aop.TargetSource was not using my plugin's classloader. I was able to fix this by adding spring-aop to core/pom.xml. This caused the JAR to be bundled into Hudson's main lib directory and allowed my plugin to load. I would be happy with any solution that allows my plugin to load without having to modify Hudson.

    Jenkins JIRA | 7 years ago | Mike Dillon
    hudson.util.IOException2: Failed to initialize
  2. 0

    While trying to use the Spring classes embedded into the Hudson war in a plugin, I encountered the following exception: hudson.util.IOException2: Failed to initialize at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:224) at hudson.PluginManager.<init>(PluginManager.java:156) at hudson.model.Hudson.<init>(Hudson.java:542) at hudson.WebAppMain$2.run(WebAppMain.java:191) Caused by: java.lang.NoClassDefFoundError: org/springframework/aop/TargetSource at hudson.plugins.jmx.PluginImpl.start(PluginImpl.java:29) at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:232) at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:221) ... 3 more Caused by: java.lang.ClassNotFoundException: org.springframework.aop.TargetSource at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) ... 6 more The issue is that the classes from spring-context that I am using depend on spring-aop. The spring-aop artifact is declared as optional in the spring-context POM file, so it is not bundled with the WAR. The spring-context JAR is being pulled in transitively via Hudson's dependency on spring-web. I attempted to work around this problem by adding spring-aop to the POM file for my plugin, but still saw the NoClassDefFoundError, likely because the class triggering the load of org.springframework.aop.TargetSource was not using my plugin's classloader. I was able to fix this by adding spring-aop to core/pom.xml. This caused the JAR to be bundled into Hudson's main lib directory and allowed my plugin to load. I would be happy with any solution that allows my plugin to load without having to modify Hudson.

    Jenkins JIRA | 7 years ago | Mike Dillon
    hudson.util.IOException2: Failed to initialize
  3. 0

    Drools: Developer (committer) mailing list - MOVED - M2 Guvnor Tomcat Deployment Issues and Resolutions

    nabble.com | 8 months ago
    java.lang.ClassNotFoundException: javax.persistence.Entity at >>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360) at >>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Java: Exception in thread main java.lang.NoClassDefFoundError

    tech-recipes.com | 3 months ago
    java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
  6. 0

    Ant « WebLogic

    middlewaremagic.com | 3 months ago
    java.lang.NoClassDefFoundError: weblogic/utils/NestedException

    12 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassNotFoundException

      org.springframework.aop.TargetSource at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)

      at java.lang.ClassLoader.loadClassInternal()
    2. Java RT
      ClassLoader.loadClassInternal
      1. java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      1 frame
    3. hudson.plugins.jmx
      PluginImpl.start
      1. hudson.plugins.jmx.PluginImpl.start(PluginImpl.java:29)
      1 frame
    4. Hudson
      WebAppMain$2.run
      1. hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:232)
      2. hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:221)
      3. hudson.PluginManager.<init>(PluginManager.java:156)
      4. hudson.model.Hudson.<init>(Hudson.java:542)
      5. hudson.WebAppMain$2.run(WebAppMain.java:191)
      5 frames