maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: MNG-2571 - weird exception using the embedder
Date Sun, 01 Oct 2006 15:19:36 GMT

On Oct 1, 2006, at 2:04 AM, Stephane Nicoll wrote:

> Hi,
>
> I think I've discovered a weird bug[1] in plexus and/or the maven
> embedder and I am unable to find what's wrong.
>
> I am using the embedder to create a test suite for the Ear Plugin ; it
> has a 'modules' complex configuration section which is an array of
> EarModules[2]. When running the plugin with maven normally, it works
> fine and the EarModule array is populated with the pom's configuration
> settings.
>
> With the embedder, I got an ArrayStoreException[3], meaning that we
> tried to copy a value with a wrong type in the array.
>
> I've tracked down the error to ArrayConverter in
> plexus-container-default. The thing I don't understand is that I am
> unable to understand the cause of the exception. I have added
> quick&dirty debugging statements in a local checkout of
> plexus-container-default-alpha9 and it gives the following:
>
> The component Type is[ interface  
> org.apache.maven.plugin.ear.EarModule]
> The values elements are the following
> Object class[org.apache.maven.plugin.ear.EjbModule] - is NOT
> assignable to[interface org.apache.maven.plugin.ear.EarModule] !!!
>
> When I copy paste this debugging statement in a JUnit test and I build
> the EjbModule object myself it gives the following:
>
> The component Type is[ interface  
> org.apache.maven.plugin.ear.EarModule]
> The values elements are the following
> Object class[org.apache.maven.plugin.ear.EjbModule] - is assignable
> to[interface org.apache.maven.plugin.ear.EarModule]
>
>
> So what am I missing? How come that 'isInstance' method from the Class
> object could return different results?

The classes are in different classloaders.  Hopefully the  
classloaders' toString() will give you enough info about which ones  
they are if you add that to the debugging.

thanks
david jencks

>
> Any idea?
>
> Thanks,
> St├ęphane
>
>
> [1] http://jira.codehaus.org/browse/MNG-2571
> [2] http://maven.apache.org/plugins/maven-ear-plugin/howto.html
> [3] http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ 
> ArrayStoreException.html
>
> -- 
> Un chewing-gum? Non merci, jamais pour parler.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message