Hadoop Common
  1. Hadoop Common
  2. HADOOP-7514

Build fails with ClassCastException when running both mvn-install and mvn-deploy targets

    Details

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

      RHEL 6.1 & Ubuntu 11.04; Sun JDK 1.6_016 & Sun JDK 1.6.0_26; Ant 1.8.2; Maven 3.0.2

    • Hadoop Flags:
      Reviewed

      Description

      Although this may not be a common use-case, the exception thrown is really confusing and does not clarify what the problem is.

      The resulting error is: java.lang.ClassCastException: org.codehaus.plexus.DefaultPlexusContainer cannot be cast to org.codehaus.plexus.PlexusContainer

      The error occurs because mvn-init target gets called twice.

      1. HADOOP-7514.patch
        0.8 kB
        Joep Rottinghuis

        Activity

        Joep Rottinghuis created issue -
        Hide
        Joep Rottinghuis added a comment -

        Full stacktrace in build log:
        simpledeploy:

        BUILD FAILED
        /home/jrottinghuis/git/hadoop-common/common/build.xml:1327: java.lang.ClassCastException: org.codehaus.plexus.DefaultPlexusContainer cannot be cast to org.codehaus.plexus.PlexusContainer
        at org.apache.maven.artifact.ant.AbstractArtifactTask.getContainer(AbstractArtifactTask.java:483)
        at org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:458)
        at org.apache.maven.artifact.ant.AbstractArtifactTask.initSettings(AbstractArtifactTask.java:287)
        at org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractArtifactTask.java:677)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

        Show
        Joep Rottinghuis added a comment - Full stacktrace in build log: simpledeploy: BUILD FAILED /home/jrottinghuis/git/hadoop-common/common/build.xml:1327: java.lang.ClassCastException: org.codehaus.plexus.DefaultPlexusContainer cannot be cast to org.codehaus.plexus.PlexusContainer at org.apache.maven.artifact.ant.AbstractArtifactTask.getContainer(AbstractArtifactTask.java:483) at org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:458) at org.apache.maven.artifact.ant.AbstractArtifactTask.initSettings(AbstractArtifactTask.java:287) at org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractArtifactTask.java:677) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:809) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
        Hide
        Joep Rottinghuis added a comment -

        Does not apply to trunk due to HADOOP-6671

        Show
        Joep Rottinghuis added a comment - Does not apply to trunk due to HADOOP-6671
        Hide
        Joep Rottinghuis added a comment -

        Patch records property to avoid calling mvn-taskdef target twice.

        Show
        Joep Rottinghuis added a comment - Patch records property to avoid calling mvn-taskdef target twice.
        Joep Rottinghuis made changes -
        Field Original Value New Value
        Attachment HADOOP-7514.patch [ 12489379 ]
        Joep Rottinghuis made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Konstantin Boudnik added a comment -

        +1 patch look good.
        I have applied it and the casting problem has disappeared. Good finding Joep. I'll commit this shortly.

        Show
        Konstantin Boudnik added a comment - +1 patch look good. I have applied it and the casting problem has disappeared. Good finding Joep. I'll commit this shortly.
        Hide
        Konstantin Boudnik added a comment -

        I have committed this. Thanks Joep!

        Show
        Konstantin Boudnik added a comment - I have committed this. Thanks Joep!
        Konstantin Boudnik made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Fix Version/s 0.22.0 [ 12314296 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-22-branch #67 (See https://builds.apache.org/job/Hadoop-Common-22-branch/67/)
        HADOOP-7514. Build fails with ClassCastException when running both mvn-install and mvn-deploy targets. Contributed by Joep Rottinghuis.

        cos : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1154636
        Files :

        • /hadoop/common/branches/branch-0.22/common/CHANGES.txt
        • /hadoop/common/branches/branch-0.22/common/build.xml
        Show
        Hudson added a comment - Integrated in Hadoop-Common-22-branch #67 (See https://builds.apache.org/job/Hadoop-Common-22-branch/67/ ) HADOOP-7514 . Build fails with ClassCastException when running both mvn-install and mvn-deploy targets. Contributed by Joep Rottinghuis. cos : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1154636 Files : /hadoop/common/branches/branch-0.22/common/CHANGES.txt /hadoop/common/branches/branch-0.22/common/build.xml
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        53m 35s 1 Joep Rottinghuis 04/Aug/11 19:31
        Patch Available Patch Available Resolved Resolved
        2d 7h 24m 1 Konstantin Boudnik 07/Aug/11 02:55

          People

          • Assignee:
            Joep Rottinghuis
            Reporter:
            Joep Rottinghuis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development