Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-14983

hpi:run fails with IllegalAccessError: jenkins/plugins/ui_samples/DropdownList$1

XMLWordPrintable

      Ran a plugin using maven-hpi-plugin:1.74:run. the.hpl included ui-samples-plugin-1.447.jar since 4ace69e in 1.87 was not yet applied. Got some errors, initially

      Aug 29, 2012 9:37:57 AM hudson.ExtensionFinder$AbstractGuiceFinder$2$1 get
      WARNING: Failed to instantiate. Skipping this component
      com.google.inject.ProvisionException: Guice provision errors:
      
      1) Error injecting constructor, java.lang.IllegalAccessError: tried to access class jenkins.plugins.ui_samples.DropdownList$1 from class jenkins.plugins.ui_samples.DropdownList
        at jenkins.plugins.ui_samples.DropdownList$DescriptorImpl.<init>(DropdownList.java:55)
      
      1 error
      	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
      	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
      	at hudson.ExtensionFinder$AbstractGuiceFinder$2$1.get(ExtensionFinder.java:365)
      	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
      	at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
      	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
      	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
      	at hudson.ExtensionFinder$AbstractGuiceFinder._find(ExtensionFinder.java:336)
      	at hudson.ExtensionFinder$AbstractGuiceFinder.find(ExtensionFinder.java:327)
      	at hudson.ExtensionFinder._find(ExtensionFinder.java:147)
      	at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:289)
      	at hudson.ExtensionList.load(ExtensionList.java:278)
      	at hudson.ExtensionList.ensureLoaded(ExtensionList.java:231)
      	at hudson.ExtensionList.getComponents(ExtensionList.java:149)
      	at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:182)
      	at hudson.ExtensionList.ensureLoaded(ExtensionList.java:231)
      	at hudson.ExtensionList.iterator(ExtensionList.java:138)
      	at org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsIterator(ExpressionSupport.java:101)
      	at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:89)
      	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119)
      	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)
      	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
      	at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
      	at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:107)
      	at org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:125)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:552)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:648)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:159)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:162)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
      	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
      	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      	at org.mortbay.jetty.Server.handle(Server.java:285)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
      	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
      Caused by: java.lang.IllegalAccessError: tried to access class jenkins.plugins.ui_samples.DropdownList$1 from class jenkins.plugins.ui_samples.DropdownList
      	at java.lang.Class.getDeclaringClass(Native Method)
      	at java.lang.Class.getEnclosingClass(Class.java:1105)
      	at hudson.model.Descriptor.<init>(Descriptor.java:236)
      	at jenkins.plugins.ui_samples.UISampleDescriptor.<init>(UISampleDescriptor.java:8)
      	at jenkins.plugins.ui_samples.DropdownList$DescriptorImpl.<init>(DropdownList.java:55)
      	at jenkins.plugins.ui_samples.DropdownList$DescriptorImpl$$FastClassByGuice$$f8fe1cda.newInstance(<generated>)
      	at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
      	at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
      	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
      	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87)
      	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:259)
      	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
      	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
      	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
      	... 63 more
      

      and later every page load and other things fail with

      java.lang.IllegalAccessError: jenkins/plugins/ui_samples/DropdownList$1
      	at java.lang.Class.getDeclaringClass(Native Method)
      	at java.lang.Class.getEnclosingClass(Class.java:1105)
      	at java.lang.Class.getSimpleBinaryName(Class.java:1240)
      	at java.lang.Class.getSimpleName(Class.java:1132)
      	at jenkins.plugins.ui_samples.DropdownList$FruitDescriptor.getDisplayName(DropdownList.java:72)
      	at hudson.ExtensionComponent.compareTo(ExtensionComponent.java:80)
      	at hudson.ExtensionComponent.compareTo(ExtensionComponent.java:36)
      	at java.util.ComparableTimSort.binarySort(ComparableTimSort.java:232)
      	at java.util.ComparableTimSort.sort(ComparableTimSort.java:176)
      	at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
      	at java.util.Arrays.sort(Arrays.java:472)
      	at java.util.Collections.sort(Collections.java:155)
      	at hudson.ExtensionList.sort(ExtensionList.java:298)
      	at hudson.ExtensionList.ensureLoaded(ExtensionList.java:233)
      	at hudson.ExtensionList.iterator(ExtensionList.java:138)
      

      Not exactly sure what is going on here (two different class loaders finding nested classes from the same source file?) but DropdownList$1 can at least be elided by making the Fruit constructor be accessible to subclasses without compiler fakery; and the second exception can be made nonfatal.

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: