// This issue has been originally created by Per Arnold Blaasmo for RoleMacro extensions in Ownership plugin.
Seems that ClassicPluginStrategy improperly searches for extensions, which use optional dependencies of plugin. It leads to warnings inside plugin loading procedures.
Reproduction steps:
- Install a plugin, which has a non-describable extension for missing optional dependency (e.g. ownership plugin without role-strategy)
- Restart Jenkins
- Check jenkins.log. You should see a "ClassNotFound" exception in the log (see the example below)
Analysis results:
- Strangely, the issue appears in jenkins.getPluginManager().getPluginStrategy().findComponents(extensionType, hudson) with extensionType == hudson.model.Descriptor. However, role-strategy's RoleMacros are not describable => they should not appear in the list
- In real, the extensions class presents in classes.jar, but its classloading fails due to missing dependency
Class loading stack trace:
ClassLoaderReflectionToolkit.findClass:44
PluginManager$UberClassLoader.findClass:969
ClassLoader.loadClass:423
ClassLoader.loadClass:356
Hidden Source Calls
ExtensionFinder$Sezpoz.scout:666
ClassicPluginStrategy.findComponents:310
....
The log fills up with the following warnings from the ownership plugin:
Dec 27, 2013 11:18:35 AM hudson.ExtensionFinder$Sezpoz scout
WARNING: Failed to scout com.synopsys.arc.jenkins.plugins.ownership.security.rolestrategy.CoOwnerRoleMacroNoSid
java.lang.InstantiationException: /storage/hudson-home/plugins/ownership/WEB-INF/lib/classes.jar might need to be rebuilt: java.lang.ClassNotFoundException: com.synopsys.arc.jenkins.plugins.ownership.security.rolestrategy.CoOwnerRoleMacroNoSid
at net.java.sezpoz.IndexItem.element(IndexItem.java:144)
at hudson.ExtensionFinder$Sezpoz.scout(ExtensionFinder.java:666)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:310)
at hudson.ExtensionList.load(ExtensionList.java:295)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:248)
at hudson.ExtensionList.iterator(ExtensionList.java:138)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:309)
at hudson.ExtensionList.load(ExtensionList.java:295)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:248)
at hudson.ExtensionList.getComponents(ExtensionList.java:149)
at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:182)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:248)
at hudson.ExtensionList.iterator(ExtensionList.java:138)
at org.jenkinsci.plugins.xunit.AliasInitializer.addAliases(AliasInitializer.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105)
at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:897)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: com.synopsys.arc.jenkins.plugins.ownership.security.rolestrategy.CoOwnerRoleMacroNoSid
at hudson.PluginManager$UberClassLoader.findClass(PluginManager.java:984)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at net.java.sezpoz.IndexItem.element(IndexItem.java:134)
... 26 more
- is related to
-
JENKINS-17425 WARNING: "Failed to scout hudson.security.PAMSecurityRealm" and "Failed to scout hudson.model.ExternalJob"
- Resolved