mockStatic giving NoClassDefFoundError

5,924 views
Skip to first unread message

Anoop

unread,
Nov 23, 2009, 2:43:24 PM11/23/09
to PowerMock
Hi, I'm a newbie to Powermock. I'm able to test all features of
Powermock except mockStatic. When I try mockStatic(Abc.class);, it
gives me this error:
java.lang.NoClassDefFoundError: com.model.Abc$$EnhancerByCGLIB$
$e4f7896b

I do have all the jars in the classpath.

Please help me resolve this.

Johan Haleby

unread,
Nov 24, 2009, 2:20:28 AM11/24/09
to powe...@googlegroups.com
Hm that's very strange? Are you sure you have everything in your classpath (you need all the dependencies in classpath as well)? Even if you do you need to make sure that it's not conflicting with other jars that may get precedence over the powermock jars and it's dependencies. Mockinging static methods seems to be working for everyone else so I assume that you have something wrong in your setup.

/Johan


--

You received this message because you are subscribed to the Google Groups "PowerMock" group.
To post to this group, send email to powe...@googlegroups.com.
To unsubscribe from this group, send email to powermock+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/powermock?hl=.



Anoop

unread,
Nov 24, 2009, 11:51:29 AM11/24/09
to PowerMock
When I use @PrepareForTest, I get the error mentioned. If dont use it
the code passes through mockStatic() line but the expect() doesn't
work fine. It actually executes the method that I set expectation on.

On Nov 24, 2:20 am, Johan Haleby <johan.hal...@gmail.com> wrote:
> Hm that's very strange? Are you sure* *you have *everything* in your
> classpath (you need all the dependencies in classpath as well)? Even if you
> do you need to make sure that it's not conflicting with other jars that may
> get precedence over the powermock jars and it's dependencies. Mockinging
> static methods seems to be working for everyone else so I assume that you
> have something wrong in your setup.
>
> /Johan
>
> On Mon, Nov 23, 2009 at 8:43 PM, Anoop <anair.in...@gmail.com> wrote:
> > Hi, I'm a newbie to Powermock. I'm able to test all features of
> > Powermock except mockStatic. When I try mockStatic(Abc.class);, it
> > gives me this error:
> > java.lang.NoClassDefFoundError: com.model.Abc$$EnhancerByCGLIB$
> > $e4f7896b
>
> > I do have all the jars in the classpath.
>
> > Please help me resolve this.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "PowerMock" group.
> > To post to this group, send email to powe...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > powermock+...@googlegroups.com<powermock%2Bunsu...@googlegroups.com>
> > .

Johan Haleby

unread,
Nov 24, 2009, 4:10:43 PM11/24/09
to powe...@googlegroups.com
Could you reproduce this and show me the test and code under test?
Does it happen in Eclipse or maven or both?
> To unsubscribe from this group, send email to powermock+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/powermock?hl=en.
>
>
>

Anoop

unread,
Nov 25, 2009, 11:43:59 AM11/25/09
to PowerMock
StaticClass.java:
package com.anoop.test;

public class StaticClass {


public static String getName(){
return "Anoop";
}

public static void setName(String name){
System.out.println(name);
}
}

AnoopClass.java:
package com.anoop.test;

public class AnoopClass {

private String name;
public void doSomething(){
name = StaticClass.getName();
name = name + " does something";
}

public String getName(){
return name;
}
}

The Junit class:

package com.anoop.test;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import static org.powermock.api.easymock.PowerMock.*;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.isA;
import static org.easymock.EasyMock.isNull;

@RunWith(PowerMockRunner.class)
@PrepareForTest({StaticClass.class})
public class AnoopClassTest {

private AnoopClass anoopClass;

@Before
public void setUp() throws Exception {
anoopClass = new AnoopClass();
}

@Test
public void testDoSomething() {
mockStatic(StaticClass.class);
expect(StaticClass.getName()).andReturn("Deepa");
replay(StaticClass.class);
anoopClass.doSomething();
System.out.println(anoopClass.getName());
verify(StaticClass.class);
}

}

Error trace:
java.lang.NoClassDefFoundError: com.anoop.test.StaticClass$
$EnhancerByCGLIB$$3caf6adf
at sun.reflect.GeneratedSerializationConstructorAccessor6.newInstance
(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
at
org.easymock.classextension.internal.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance
(SunReflectionFactoryInstantiator.java:40)
at
org.easymock.classextension.internal.objenesis.ObjenesisBase.newInstance
(ObjenesisBase.java:58)
at
org.easymock.classextension.internal.objenesis.ObjenesisHelper.newInstance
(ObjenesisHelper.java:28)
at
org.easymock.classextension.internal.ObjenesisClassInstantiator.newInstance
(ObjenesisClassInstantiator.java:12)
at
org.powermock.api.easymock.internal.signedsupport.SignedSupportingClassProxyFactory.createProxy
(SignedSupportingClassProxyFactory.java:201)
at org.easymock.internal.MocksControl.createMock(MocksControl.java:
40)
at org.powermock.api.easymock.PowerMock.doCreateMock(PowerMock.java:
2155)
at org.powermock.api.easymock.PowerMock.doMock(PowerMock.java:2110)
at org.powermock.api.easymock.PowerMock.mockStatic(PowerMock.java:
290)
at com.anoop.test.AnoopClassTest.testDoSomething(AnoopClassTest.java:
28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:66)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl
$PowerMockJUnit44MethodRunner.runTestMethod
(PowerMockJUnit44RunnerDelegateImpl.java:322)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:
86)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters
(MethodRoadie.java:94)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl
$PowerMockJUnit44MethodRunner.executeTest
(PowerMockJUnit44RunnerDelegateImpl.java:309)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl
$PowerMockJUnit47MethodRunner.executeTestInSuper
(PowerMockJUnit47RunnerDelegateImpl.java:73)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl
$PowerMockJUnit47MethodRunner.executeTest
(PowerMockJUnit47RunnerDelegateImpl.java:53)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl
$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters
(PowerMockJUnit44RunnerDelegateImpl.java:297)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:
84)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod
(PowerMockJUnit44RunnerDelegateImpl.java:222)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods
(PowerMockJUnit44RunnerDelegateImpl.java:161)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl
$1.run(PowerMockJUnit44RunnerDelegateImpl.java:135)
at org.junit.internal.runners.ClassRoadie.runUnprotected
(ClassRoadie.java:34)
at org.junit.internal.runners.ClassRoadie.runProtected
(ClassRoadie.java:44)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run
(PowerMockJUnit44RunnerDelegateImpl.java:133)
at
org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run
(JUnit4TestSuiteChunkerImpl.java:112)
at
org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run
(AbstractCommonPowerMockRunner.java:44)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:196)




On Nov 24, 4:10 pm, Johan Haleby <johan.hal...@gmail.com> wrote:
> Could you reproduce this and show me the test and code under test?
> Does it happen in Eclipse or maven or both?
>

Anoop

unread,
Nov 25, 2009, 12:43:00 PM11/25/09
to PowerMock
It happens in Eclipse. I'm using Rad 7.0 and Powermock 1.3.0. I'm not
using Maven.

Johan Haleby

unread,
Nov 26, 2009, 2:04:00 AM11/26/09
to powe...@googlegroups.com
Thanks, I'll try to reproduce it when I find the time.

/Johan

GeoffH

unread,
Nov 27, 2009, 5:44:23 AM11/27/09
to PowerMock
I've seen something similar, but ONLY under the following conditions
a) running at a Windows command prompt and launching with Maven 2
b) JAVA_HOME set to C:\Program Files (x86)\IBM\SDP70\jdk

I then get a stack trace that looks similar (although I'm using
Mockito)

-------------------------------------------------------------------------------
Test set: my.pkg.FinalCLassMockTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.234
sec <<< FAILURE!
testCreateMockDummy(my.pkg.FinalCLassMockTest) Time elapsed: 0.157
sec <<< ERROR!
java.lang.NoClassDefFoundError: my.pkg.DummyClass$
$EnhancerByMockitoWithCGLIB$$b85681c3
at sun.reflect.GeneratedSerializationConstructorAccessor13.newInstance
(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
at
org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance
(SunReflectionFactoryInstantiator.java:40)
at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:59)
at org.mockito.internal.creation.jmock.ClassImposterizer.createProxy
(ClassImposterizer.java:120)
at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise
(ClassImposterizer.java:60)
at
org.powermock.api.mockito.internal.mockcreation.MockCreator.createMethodInvocationControl
(MockCreator.java:79)
at org.powermock.api.mockito.internal.mockcreation.MockCreator.mock
(MockCreator.java:53)
at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:80)
at my.pkg.FinalCLassMock.createMockDummyClass(FinalCLassMock.java:56)

F:\Download\CodeSamples\MinimalPowerMockTest>java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build
pwi32dev-20061002a (SR3))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32
j9vmwi3223-20061001 (JIT enabled)
J9VM - 20060915_08260_lHdSMR
JIT - 20060908_1811_r8
GC - 20060906_AA)
JCL - 20061002

It also fails in Eclipse when the JRE is
C:\Program Files (x86)\IBM\SDP70\jdk\jre

I don't get this when I use:
a) JAVA_HOME=C:\Program Files (x86)\Java\jdk1.5.0_21
b) on unix under AIX

java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build
pap64devifx-20090225 (SR9-0 +IZ44410+IZ44495))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc64-64
j9vmap6423ifx-20090225 (JIT enabled)
J9VM - 20090224_30451_BHdSMr
JIT - 20081112_1511ifx1_r8
GC - 200811_07)
JCL - 20081129


GeoffH


On Nov 26, 7:04 am, Johan Haleby <johan.hal...@gmail.com> wrote:
> Thanks, I'll try to reproduce it when I find the time.
>
> /Johan
>
> > <powermock%2Bunsu...@googlegroups.com<powermock%252Buns...@googlegroups.com>
>
> > > > >> > .
> > > > >> > For more options, visit this group at
> > > > >> >http://groups.google.com/group/powermock?hl=.
>
> > > > > --
>
> > > > > You received this message because you are subscribed to the Google
> > Groups "PowerMock" group.
> > > > > To post to this group, send email to powe...@googlegroups.com.
> > > > > To unsubscribe from this group, send email to
> > powermock+...@googlegroups.com<powermock%2Bunsu...@googlegroups.com>
> > .
> > > > > For more options, visit
>
> ...
>
> read more »

Johan Haleby

unread,
Nov 27, 2009, 5:48:21 AM11/27/09
to powe...@googlegroups.com
Looks like a JVM issue to me. Could be related to objenesis, perhaps we should try to upgrade to the latest version if EasyMock supports it.

/Johan

To unsubscribe from this group, send email to powermock+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/powermock?hl=en.



Johan Haleby

unread,
Nov 27, 2009, 5:56:05 AM11/27/09
to powe...@googlegroups.com

GeoffH

unread,
Nov 27, 2009, 7:18:47 AM11/27/09
to PowerMock
I downloaded the Objenesis TCK jar and ran it under the IBM J9 JVM -
looks Ok:

F:\Tools\Objenesis>java -jar objenesis-tck-1.2.jar
Running TCK on platform: Java 1.5 (IBM Corporation IBM J9 VM 2.3
pwi32dev-20061002a (SR3))

Not serializable parent constructor called: Y

Objenesis
serializer Objenesis std
Constructor throwing exception N/
A Y
Constructor throwing exception (serializable)
Y Y
Constructor with arguments N/
A Y
Constructor with arguments (serializable)
Y Y
Constructor with mandatory arguments N/
A Y
Constructor with mandatory arguments (serializable)
Y Y
Default package constructor N/
A Y
Default package constructor (serializable)
Y Y
Default private constructor N/
A Y
Default private constructor (serializable)
Y Y
Default protected constructor N/
A Y
Default protected constructor (serializable)
Y Y
Default public constructor N/
A Y
Default public constructor (serializable)
Y Y
No constructor N/
A Y
No constructor (serializable)
Y Y
Serializable replacing with another class
Y Y
Serializable resolving to another class
Y Y
Serializable with ancestor throwing exception N/
A Y

--- SUCCESSFUL: TCK tests passed without errors in 47 ms

I also updated my pom.xml to Objenesis version 1.2 and launched via
Maven 2 using IBM J9 JVM
- I still got the same stack trace

GeoffH

On Nov 27, 10:56 am, Johan Haleby <johan.hal...@gmail.com> wrote:
> Objenesis supports these JVMs:
>
>    - Sun Hotspot VM, versions 1.3, 1.4, 1.5 and 1.6
>    - GCJ version 3.4.4 (tested on Windows/Cygwin)
>    - BEA JRockit versions 7.0 (1.3.1), 1.4.2 and 1.5
>    - Aonix PERC (no serialization support), tested on version 5.0.0667
>
> IBM J9 VM is not listed here so it may not work on this JVM. Is RAD 7 also
> using this JVM?
>
> /Johan
>
> On Fri, Nov 27, 2009 at 11:48 AM, Johan Haleby <johan.hal...@gmail.com>wrote:
>
> > Looks like a JVM issue to me. Could be related to objenesis, perhaps we
> > should try to upgrade to the latest version if EasyMock supports it.
>
> > /Johan
>
> ...
>
> read more »

Johan Haleby

unread,
Nov 27, 2009, 10:00:37 AM11/27/09
to powe...@googlegroups.com
Many thanks for helping us out with this! Then I guess we have to look somewhere else to see what could cause the problem.

Actually now that I come to think of it we've had a similar problem a looong time ago with EasyMock and CGLib and Maven (using the SUN JVM though) and we ended up creating a really ugly hack to get around it in our MockClassloader. I think it's still present to this day. Maybe this is similar to that but for Mockito. It's worth checking out I suppose, I'll add a reminding note in the issue.

/Johan

> ...
>
> read more »

Johan Haleby

unread,
Nov 27, 2009, 12:18:36 PM11/27/09
to powe...@googlegroups.com
GeoffH, could you checkout the latest version from the trunk and try to run your tests again and tell me whether you experience the same problem?

/Johan

GeoffH

unread,
Dec 2, 2009, 11:19:42 AM12/2/09
to PowerMock
Johan,

Sorry, I have been on something else for a couple of days and have
only just picked this up

Because of the security constraints where I am currently working, I am
not able to do an SVN checkout from an external site
Is it possible you can send a zip file to my email address

Thanks,

GeoffH

On Nov 27, 5:18 pm, Johan Haleby <johan.hal...@gmail.com> wrote:
> GeoffH, could you checkout the latest version from the trunk and try to run
> your tests again and tell me whether you experience the same problem?
>
> /Johan
>
> On Fri, Nov 27, 2009 at 4:00 PM, Johan Haleby <johan.hal...@gmail.com>wrote:
>
> > Many thanks for helping us out with this! Then I guess we have to look
> > somewhere else to see what could cause the problem.
>
> > Actually now that I come to think of it we've had a similar problem a
> > looong time ago with EasyMock and CGLib and Maven (using the SUN JVM though)
> > and we ended up creating a really ugly hack to get around it in our
> > MockClassloader. I think it's still present to this day. Maybe this is
> > similar to that but for Mockito. It's worth checking out I suppose, I'll add
> > a reminding note in the issue.
>
> > /Johan
>
> ...
>
> read more »

GeoffH

unread,
Dec 2, 2009, 11:30:22 AM12/2/09
to PowerMock
Johan,

Alternatively, if you can let me know which change is relevant, I can
try and patch it into the powermock-1.3.1-src that I downloaded after
1.3.1 was released

Is it r1106

GeoffH
> ...
>
> read more »

Johan Haleby

unread,
Dec 3, 2009, 2:43:01 AM12/3/09
to powe...@googlegroups.com
I've sent you the files now by mail. Please report back your result.

Thanks,
/Johan

> ...
>
> read more »

GeoffH

unread,
Dec 3, 2009, 4:38:41 AM12/3/09
to PowerMock
Johan,

I picked up the 1.4-SNAPHOT zip and carried out 4 tests:
1) IBM Java with PowerMock 1.3.1
2) IBM Java with PowerMock 1.4-SNAPSHOT
3) Sun Java with PowerMock 1.3.1
4) Sun Java with PowerMock 1.4-SNAPSHOT

The tests were invoked with:
mvn clean test
- the log results are in the recently uploaded file
1.4SnapshotTests.zip

The results for 1) and 2) are very similar and have 21 errors
This is due to java.lang.NoClassDefFoundError
A Surefire log is also included as a typical failure
- BaseCommonTest was obtained running with 1.4-SNAPSHOT

The results for 3) (Sun Java and 1.3.1) show 3 errors and 1 failure -
these are expected

The results for 4) (Sun Java and 1.4-SNAPSHOT) show additional
failures over 3)
This is because I have implemented findResource in MockCLassLoader in
my 1.3.1 version
- and I guess it is not in 1.4-SNAPSHOT

For BaseCommonTest, the failure occurs at:
com.visaeu.rcs.application.cas.parser.ParserTestMockData.createMockRCSCodepageTranslationService
(ParserTestMockData.java:267)

This is in ParserTestMockData at the line:
PowerMockito.mockStatic(RCSCodepageTranslationService.class);

BaseCommonTest is annotated:
@RunWith(PowerMockRunner.class)
@PrepareForTest({TransactionParserHelp.class,
RCSCodepageTranslationService.class})
public class BaseCommonTest extends TestCase

I think I conclude that changes put into 1.4-SNAPSHOT have made no
difference to running with IBM Java

I will check the Surefire logs to see if the NoClassDefFound Error is
always as a result of MockStatic

GeoffH


On Dec 3, 7:43 am, Johan Haleby <johan.hal...@gmail.com> wrote:
> I've sent you the files now by mail. Please report back your result.
>
> Thanks,
> /Johan
>
> ...
>
> read more »

Johan Haleby

unread,
Dec 3, 2009, 6:27:38 AM12/3/09
to powe...@googlegroups.com
Thanks a lot for your investigation, great work! I'll try to get your findResource implementation into the next version of PowerMock as well (it will definitely go into the next major version at least). Please look into the surefire logs and see if you get the same error though.

/Johan

> ...
>
> read more »

GeoffH

unread,
Dec 3, 2009, 7:22:54 AM12/3/09
to PowerMock
Johan,

I've had a look at the Surefire logs and pulled out the common cases
Stack trace below

It is NOT just as a result of using mockStatic; it can also occur with
PowerMockito.mock
mock (org.mockito.Mockito.mock)

Eventually, they all end up at
at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:59)

I'm using Objenesis 1.1 (but I tried 1.2 earlier and it made no
difference)

GeoffH

testJodaTimeGetDummyClass2(my.pkg.JodaDateTimeTest) Time elapsed:
0.047 sec <<< ERROR!
java.lang.NoClassDefFoundError: my.pkg.DummyClass$
$EnhancerByMockitoWithCGLIB$$44487cfb
at sun.reflect.GeneratedSerializationConstructorAccessor10.newInstance
(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
at
org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance
(SunReflectionFactoryInstantiator.java:40)
at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:59)
at org.mockito.internal.creation.jmock.ClassImposterizer.createProxy
(ClassImposterizer.java:120)
at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise
(ClassImposterizer.java:60)
at
org.powermock.api.mockito.internal.mockcreation.MockCreator.createMethodInvocationControl
(MockCreator.java:79)
at org.powermock.api.mockito.internal.mockcreation.MockCreator.mock
(MockCreator.java:53)
at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:80)
at my.pkg.FinalCLassMock.createMockDummyClass(FinalCLassMock.java:56)

FinalCLassMock.java:56
mockDummyClass = PowerMockito.mock(DummyClass.class);
--------------------------------------------------------------------------------
at org.powermock.api.mockito.internal.mockcreation.MockCreator.mock
(MockCreator.java:53)
at org.powermock.api.mockito.PowerMockito.mockStatic
(PowerMockito.java:67)
at
com.visaeu.rcs.application.cas.parser.ParserTestMockData.createMockRCSCodepageTranslationService
(ParserTestMockData.java:267)

ParserTestMockData.java:267
PowerMockito.mockStatic(RCSCodepageTranslationService.class);
--------------------------------------------------------------------------------

at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:59)
at org.mockito.internal.creation.jmock.ClassImposterizer.createProxy
(ClassImposterizer.java:111)
at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise
(ClassImposterizer.java:51)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:55)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:34)
at org.mockito.Mockito.mock(Mockito.java:825)
at org.mockito.Mockito.mock(Mockito.java:721)
at
com.visaeu.rcs.application.cas.parser.ParserTestMockData.createMockRcsFileHeader
(ParserTestMockData.java:239)

ParserTestMockData.java:239 (org.mockito.Mockito.mock)
mockRcsFileHeader = mock(RcsFileHeader.class);

--------------------------------------------------------------------------------

at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise
(ClassImposterizer.java:51)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:55)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:34)
at org.mockito.Mockito.mock(Mockito.java:825)
at org.mockito.Mockito.mock(Mockito.java:721)
at
com.visaeu.rcs.application.cas.parser.ParserTestMockData.createMockTransaction
(ParserTestMockData.java:280)

ParserTestMockData.java:280
mockTransaction = mock(Transaction.class);
--------------------------------------------------------------------------------


On Dec 3, 11:27 am, Johan Haleby <johan.hal...@gmail.com> wrote:
> Thanks a lot for your investigation, great work! I'll try to get your
> findResource implementation into the next version of PowerMock as well (it
> will definitely go into the next major version at least). Please look into
> the surefire logs and see if you get the same error though.
>
> /Johan
>
> ...
>
> read more »

Johan Haleby

unread,
Dec 3, 2009, 7:28:22 AM12/3/09
to powe...@googlegroups.com
Thanks. Is it possible for you to figure out which classloader that loads org.objenesis.ObjenesisBase? It's hard to know what the problem is when I can't reproduce it myself. Feel free to mail me personally if you think it's more appropriate.

/Johan

> ...
>
> read more »

Reply all
Reply to author
Forward
0 new messages