stapler
  1. stapler
  2. STAPLER-14

stapler:apt-compile fails under JDK 7

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      JDK 7 (GA), Ubuntu 10.04, Maven 3.0.3

      Description

      Using https://github.com/hudson/hudson.git @fb41e9ef1b3fa070e9e2e74501fe298eb0fc1a17 as an example:

      $ JAVA_HOME=.../jdk7 .../bin/mvn -DskipTests=true --also-make --projects hudson-maven3/maven3-plugin install
      ....
      [INFO] --- maven-stapler-plugin:1.15:apt-compile (default-apt-compile) @ hudson-core ---
      Sep 21, 2011 12:20:33 PM org.sonatype.guice.bean.reflect.NamedClass
      WARNING: Error injecting: org.kohsuke.stapler.AptCompiler
      java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory
      	at java.lang.Class.getDeclaredConstructors0(Native Method)
      	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
      	at java.lang.Class.getDeclaredConstructors(Class.java:1853)
      	at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:243)
      	at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:96)
      	at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:628)
      	at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:835)
      	at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:769)
      	at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:254)
      	at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205)
      	at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:843)
      	at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:957)
      	at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:990)
      	at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:951)
      	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
      	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
      	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
      	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
      	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021)
      	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
      	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
      	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
      	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
      	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014)
      	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
      	at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
      	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
      	at java.util.AbstractMap.get(AbstractMap.java:182)
      	at org.codehaus.plexus.compiler.manager.DefaultCompilerManager.getCompiler(DefaultCompilerManager.java:54)
      	at org.kohsuke.stapler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:260)
      	at org.kohsuke.stapler.CompilerMojo.execute(CompilerMojo.java:111)
      	at org.kohsuke.stapler.AptMojo.execute(AptMojo.java:21)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      	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:84)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      	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:601)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: java.lang.ClassNotFoundException: com.sun.mirror.apt.AnnotationProcessorFactory
      	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
      	... 53 more
      ....
      [ERROR] Failed to execute goal org.kohsuke.stapler:maven-stapler-plugin:1.15:apt-compile (default-apt-compile) on project hudson-core: Execution default-apt-compile of goal org.kohsuke.stapler:maven-stapler-plugin:1.15:apt-compile failed: Guice provision errors:
      [ERROR] 
      [ERROR] 1) Error injecting: org.kohsuke.stapler.AptCompiler
      [ERROR] at ClassRealm[plugin>org.kohsuke.stapler:maven-stapler-plugin:1.15, parent: sun.misc.Launcher$AppClassLoader@117140b]
      [ERROR] at ClassRealm[plugin>org.kohsuke.stapler:maven-stapler-plugin:1.15, parent: sun.misc.Launcher$AppClassLoader@117140b]
      [ERROR] while locating org.codehaus.plexus.compiler.Compiler annotated with @com.google.inject.name.Named(value=stapler-apt)
      [ERROR] 
      [ERROR] 1 error: com/sun/mirror/apt/AnnotationProcessorFactory: com.sun.mirror.apt.AnnotationProcessorFactory
      ....
      

      Works with JDK 6. Similar problem with Maven 2.2.1.

        Issue Links

          Activity

          Hide
          akozak added a comment -

          This issue is related to Hudson but not Stapler. The latest stapler uses JSR-269 and works fine on JDK7.
          If you want to fix this issue please create issue in Hudson project.

          Show
          akozak added a comment - This issue is related to Hudson but not Stapler. The latest stapler uses JSR-269 and works fine on JDK7. If you want to fix this issue please create issue in Hudson project.
          Hide
          kohsuke added a comment -

          Can't comment on why Hudson doesn't build on JavaSE 7, but on Jenkins it's already fixed: https://issues.jenkins-ci.org/browse/JENKINS-10490

          Show
          kohsuke added a comment - Can't comment on why Hudson doesn't build on JavaSE 7, but on Jenkins it's already fixed: https://issues.jenkins-ci.org/browse/JENKINS-10490
          Hide
          akozak added a comment -

          The issue is partially fixed, commit https://github.com/hudson/hudson/commit/f19d2dbfe9c472bb4b0d38e693a02d1fa5f25b73.
          There is still an issue with maven-enunciate-plugin which used in Hudson Rest module.
          The latest version of enunciate doesn't support JDK7 (http://jira.codehaus.org/browse/ENUNCIATE-603), but the author of the library promises to fix it in 2.6 release.

          Show
          akozak added a comment - The issue is partially fixed, commit https://github.com/hudson/hudson/commit/f19d2dbfe9c472bb4b0d38e693a02d1fa5f25b73 . There is still an issue with maven-enunciate-plugin which used in Hudson Rest module. The latest version of enunciate doesn't support JDK7 ( http://jira.codehaus.org/browse/ENUNCIATE-603 ), but the author of the library promises to fix it in 2.6 release.

            People

            • Assignee:
              kohsuke
              Reporter:
              jglick
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: