You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by James Krygowski <ja...@shaws.com> on 2002/08/13 19:33:23 UTC

Junit Task, VerifyError, Log4J LogManager

Hi All-

I've got a suite of JUnit tests that I'd like to run in Ant using the JUNIT
task.  I've set up the task and it does run all my tests, however, any tests
that include Log4J fail with the following (output from the Ant Junit
Report):

Testcase: testGetInstanceOfFactory took 0.24 sec
	Caused an ERROR
(class: org/apache/log4j/LogManager, method: <clinit> signature: ()V)
Incompatible argument to function
java.lang.VerifyError: (class: org/apache/log4j/LogManager, method: <clinit>
signature: ()V) Incompatible argument to function

If I run the same tests outside of Ant they run just fine.  I've checked my
classpath and there is only one instance of the Log4J jar on the classpath.
The classpath being used by Ant is identical to the classpath in the IDE I'm
using to run the unit tests.

Is this some kind of strange Ant class loader issue?  Does anyone have a
suggestion for fixing this?

thanks,

jk


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Junit Task, VerifyError, Log4J LogManager

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Have you tried fork="true" on your <junit> task?  That should fix it.

James Krygowski wrote:
> Hi All-
> 
> I've got a suite of JUnit tests that I'd like to run in Ant using the JUNIT
> task.  I've set up the task and it does run all my tests, however, any tests
> that include Log4J fail with the following (output from the Ant Junit
> Report):
> 
> Testcase: testGetInstanceOfFactory took 0.24 sec
> 	Caused an ERROR
> (class: org/apache/log4j/LogManager, method: <clinit> signature: ()V)
> Incompatible argument to function
> java.lang.VerifyError: (class: org/apache/log4j/LogManager, method: <clinit>
> signature: ()V) Incompatible argument to function
> 
> If I run the same tests outside of Ant they run just fine.  I've checked my
> classpath and there is only one instance of the Log4J jar on the classpath.
> The classpath being used by Ant is identical to the classpath in the IDE I'm
> using to run the unit tests.
> 
> Is this some kind of strange Ant class loader issue?  Does anyone have a
> suggestion for fixing this?
> 
> thanks,
> 
> jk
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>