| MHenke on Dec 5, 2008 at 1:44:36 AM (# 5) Well, tho we've a substantial lack of information here, I'll dare a SWAG. You've incompatible implementations of your logging framework. That is, in your test cycle, you're using a different version of log4j as in your build cycle. Or maybe you're using completely different logger? Check your class pathes, the corresponding libs etc. ramya narayanan on Dec 6, 2008 at 5:04:01 AM (# 6)Dear MHenke , Thanks for your reply. You are saying that I might be using a different version of log4j in my test cycle . But how to find it out that. I'm using only two log jars in my build & test . They are log4j.jar & As far as I know & search only these two jars are only there.To give clarity, I hereby present the Testcase which I've written
quote: package p2; import com.trilogy.util.override.BundleStack; import com.trilogy.util.override.BundleStackFactory; import com.trilogy.ffc.html.FFCTracer; import com.trilogy.sc.ISCCMProduct; import p1.A; import junit.framework.JUnit4TestAdapter; import junit.framework.Assert;
import java.util.Vector; import org.junit.Test; import java.lang.reflect.*; import com.trilogy.fs.dms.core.validator.test.ValidatorTestCase;
public class ATest extends ValidatorTestCase { public static junit.framework.Test suite() { System.out.println("In Test suite"); return new JUnit4TestAdapter(ATest.class); }
@Test (timeout = 50000) public void processCompEventsTest() throws Throwable{ System.out.println("Inside API Test case method to test the compevent processing ..... SAI..."); Class c=Class.forName("A"); //These processCompEvents is a protected method in A class Method m = c.getDeclaredMethod("processCompEvents", null); m.setAccessible(true); m.invoke(c, null); }
}
I've written an ant target to run this:
quote:
When I run this target by issuing this command:
quote: ant -buildfile test\test.xml Custom.test -Denvironment=LOCAL
It's giving the following error trace:
quote:
[junit] arguments are not type compatible (class: org/apache/log4j/LogManager method: ()V) at pc: 18 [junit] java.lang.VerifyError: arguments are not type compatible (class: org/apache/log4j/LogManager method: >()V) at pc: 18 [junit] at java.lang.J9VMInternals.verifyImpl(Native Method) [junit] at java.lang.J9VMInternals.verify(J9VMInternals.java:55) [junit] at java.lang.J9VMInternals.initialize(J9VMInternals.java:124) [junit] at org.apache.log4j.Logger.getLogger(Logger.java:94) [junit] at com.metlife.inst.icp.engine.Bsuper.(Bsuper.java:32) [junit] at java.lang.J9VMInternals.initializeImpl(Native Method) [junit] at java.lang.J9VMInternals.initialize(J9VMInternals.java:161) [junit] at java.lang.J9VMInternals.initialize(J9VMInternals.java:140) [junit] at java.lang.Class.forNameImpl(Native Method) [junit] at java.lang.Class.forName(Class.java:131)
The following line is in Bsuper which is a superclass for my A .java on which I'm running the test case. In line no 32 of Bsuper
quote: private static Logger m_cat = Logger.getLogger(Bsuper.class);
The following are the structure in which the test case classes & log4j jars are present
1)ValidatorTestCase.class in present in C:\.....\Test\lib as a jar file in which junit4.3.jar is also present
2) The error showing LogManager.class is present in log4j.jar present in C:\CustomizationsWorking\deploy\approot\WEB-INF\lib
3) The other log jar log4jpatch.jar is located in two places: C:\CustomizationsWorking\deploy\approot\WEB-INF\lib C:\CustomizationsWorking\customresources\lib
MHenke on Dec 9, 2008 at 5:54:28 AM (# 7) This message has been edited.Well, I really can't solve that issue from here.
However, apart from what I've already suggested: I don't know what this "log4jpatch.jar" is about. But you should ensure that your build links against the same version as your test case (as with any libs).
Another point: What JDK you're using (within your IDE) to build your app? Are your sure that the Ant task for your test case compiles against the same JDK/JRE? For example, in Eclipse I can build a project against Java 1.4 (compatibility) with the appropriate project settings. An Ant task that builds the very same project won't respect these project settings (well, at least not spontaneous).
And, please don't ask how to check what JDK/JRE your build process / Ant task is using. I don't know that. But you should... :) clintonkollman on Feb 6, 2012 at 10:34:20 PM (# 8) This message has been edited.MHenke I don't know your problem solution but you can sear in google. I thing google searching is very use full for you. ______ Ares Download
|