tiebin-zhang / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

EXCEPTION_ACCESS_VIOLATION when using PowerMockRule #480

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. I'm trying to use a PowerMockRule. 
For this I replaced the @RunWith(PowerMockRunner.class) with 
@Rule
public PowerMockRule rule = new PowerMockRule();

and annotate the test with
@Test
@PrepareForTest({ PluginUtils.class })

What is the expected output? What do you see instead?
It should work :-)

Instead java crashes with
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000002aadc5a, pid=8276, 
tid=12468
#
# JRE version: Java(TM) SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.51-b03 mixed mode 
windows-amd64 compressed oops)
# Problematic frame:
# j  
java.lang.reflect.ReflectAccess.copyField(Ljava/lang/reflect/Field;)Ljava/lang/r
eflect/Field;+1
#
# Failed to write core dump. Minidumps are not enabled by default on client 
versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\ms\workspaces\comet4\PubServerTests\hs_err_pid8276.log

What version of the product are you using? On what operating system?

Eclipse 4.3 and these libs:

014-01-10  15:11           576.338 assertj-core-1.5.0.jar
012-06-12  18:19           185.140 commons-io-2.4.jar
014-01-31  14:52            59.716 jsr166y-1.7.0.jar
014-01-31  14:53            33.031 jsr305-2.0.3.jar
014-01-31  14:30            30.391 junit-toolbox-1.5.jar
014-01-14  13:39         1.581.066 mockito-all-1.9.5.jar
014-01-21  11:35            40.568 objenesis-1.3.jar
014-02-05  13:14             4.954 powermock-classloading-base-1.5.4.jar
014-02-05  13:14             9.047 powermock-classloading-objenesis-1.5.4.jar
014-01-20  10:31           528.722 powermock-mockito-1.5.3-full.jar
014-02-05  13:13             6.594 powermock-module-junit4-rule-1.5.4.jar

Please provide any additional information below.

Original issue reported on code.google.com by pdf...@gmail.com on 5 Feb 2014 at 12:28

Attachments:

GoogleCodeExporter commented 8 years ago
I get the same error as reported above (see the attached Java error report).
I tried to adapt the Spring Integration Test with PowerMock and Mockito from 
the example für my tests: 
http://powermock.googlecode.com/svn/tags/powermock-1.5.4/examples/spring-mockito
/

I use (amongst others):
* Eclipse 4.3.1
* junit 4.8.2
* mockito-all 1.9.5
* powermock-module-junit4 1.5.4
* powermock-api-mockito 1.5.4
* powermock-module-junit4-rule 1.5.4
* powermock-classloading-objenesis 1.5.4
* Spring 3.2.7.RELEASE

Original comment by dirk.mei...@gmail.com on 18 Mar 2014 at 11:55

Attachments:

GoogleCodeExporter commented 8 years ago
Same error witch:

* powermock-easymock-1.5-full 1.5
* powermock-module-junit4-rule 1.5
* powermock-classloading-objenesis 1.5
* powermock-classloading 1.5

Original comment by andrelim...@gmail.com on 30 Jun 2014 at 7:41

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'm facing the same error with 1.5.5 version...has anyone managed how to deal 
with it?

Original comment by mauricio...@gmail.com on 10 Sep 2014 at 5:09

GoogleCodeExporter commented 8 years ago
Try using the javaagent based rule if you haven't done so already

Original comment by johan.ha...@gmail.com on 10 Sep 2014 at 5:50

GoogleCodeExporter commented 8 years ago
Well, I've tried now (thru eclipse) and I had the same error

Original comment by mauricio...@gmail.com on 10 Sep 2014 at 7:37