On Mon, Aug 15, 2011 at 1:05 PM, Barrie Treloar <[email protected]> wrote:
> On Mon, Aug 15, 2011 at 4:55 PM, Kasun Gajasinghe <[email protected]> wrote:
>> Hi,
>> We're very close to have the results.
>> maven-{clean,resources,compile}-plugin works as expected. Now, I'm at
>> [surefire:test {execution: default-test}] phase. Well, m-surefire-p is
>> giving me issues.
>>
>> I'm getting a weird ClassCastException for
>> org.apache.maven.plugin.surefire.SurefirePlugin.
>>    "java.lang.ClassCastException:
>> org.apache.maven.plugin.surefire.SurefirePlugin cannot be cast to
>> org.apache.maven.plugin.Mojo"
>
> I'm no expert in this particular error, but I thought I'd throw out
> that ClassCastExceptions also arise from ClassLoader issues as the
> same class loaded via two different class loaders are considered
> different and will give ClassCastExceptions.
> Perhaps you are running into this.

Barrie,
Indeed, it's probably due to a ClassLoader issue. I'm gonna look in to
this path further. But I doubt it's because of the same class in two
places because every Jar is loaded under highly controlled
environment. And, there's only one version of *surefire-* jars (2.9,
the latest) installed. There are two SurefirePlugin classes in
m-surefire-p, but they belong to two different packages.

I looked at the possible classloader issues causing
classcastexceptions [1]. There are three possibilities. But, I don't
see anything applies to this case since we know that it works fine in
the official distribution! I should read it again.

If you have any other possibilities popped up in your head, just let me know!

Thanks,
--Kasun

[1] 
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rtrb_classload_viewer.html

-- 
~~~*******'''''''''''''*******~~~
Kasun Gajasinghe,
University of Moratuwa,
Sri Lanka.
Blog: http://blog.kasunbg.org
Twitter: http://twitter.com/kasunbg

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to