You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2008/03/21 22:39:45 UTC

[jira] Closed: (MANT-32) java.lang.ClassCastException when packaging jeuclid-3.0.1

     [ http://jira.codehaus.org/browse/MANT-32?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MANT-32.
---------------------------------

         Assignee: Benjamin Bentmann
       Resolution: Fixed
    Fix Version/s: 2.1

Fixed in r639856, with Dennis' unit test in place.

The problem was that collection-valued parameters with only a single element were not recognized as collections. A possible though ugly workaround is to double up the single collection item:
{code:xml}
<excludes>
  <exclude>**/Bad.java</exclude>
  <exclude>**/Bad.java</exclude> <!-- once again, please -->
</excludes>
{code}
However, I don't know for sure whether all plugins would handle such a duplication gracefully. To fix the error that Peter originally faced, he would need to double up the {{<tag>}} element from his javadoc configuration.

> java.lang.ClassCastException when packaging jeuclid-3.0.1
> ---------------------------------------------------------
>
>                 Key: MANT-32
>                 URL: http://jira.codehaus.org/browse/MANT-32
>             Project: Maven 2.x Ant Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Fedora 7 Linux with Sun JDK 1.6.0_02
>            Reporter: Peter Wainwright
>            Assignee: Benjamin Bentmann
>             Fix For: 2.1
>
>         Attachments: MANT-32-testcase.patch
>
>
> "mvn package" causes java.lang.ClassCastException when packaging jeuclid-3.0.1
> Stack dump is here:
> [INFO] Building jar: /home/prw/src/jeuclid-parent-3.0.1/jeuclid-core/target/jeuclid-core-3.0.1.jar
> [INFO] [ant:ant {execution: default}]
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] java.util.HashMap cannot be cast to [Ljava.util.Map;
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.ClassCastException: java.util.HashMap cannot be cast to [Ljava.util.Map;
>         at org.apache.maven.plugin.ant.AntBuildWriterUtil.getMavenPluginOptions(AntBuildWriterUtil.java:980)
>         at org.apache.maven.plugin.ant.AntBuildWriterUtil.getMavenJavadocPluginOptions(AntBuildWriterUtil.java:823)
>         at org.apache.maven.plugin.ant.AntBuildWriterUtil.writeJavadocTask(AntBuildWriterUtil.java:533)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeJavadocTarget(AntBuildWriter.java:865)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeGeneratedBuildXml(AntBuildWriter.java:299)
>         at org.apache.maven.plugin.ant.AntBuildWriter.writeBuildXmls(AntBuildWriter.java:112)
>         at org.apache.maven.plugin.ant.AntMojo.execute(AntMojo.java:112)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Unfortunately I don't know enough Java to fix this.  Nor do I have a clue what the code is
> supposed to be doing. However, it seems that getMavenPluginConfigurationsImpl().get()
> returns a single HashMap, and getMavenPluginOptions is trying to cast this to an array of Maps.
> Is this possible?
> The previous version, 2.0-beta-1, works OK.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira