{"action":"created","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/370","labels_url":"https://api.github.com/repos/jayway/powermock/issues/370/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/370/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/370/events","html_url":"https://github.com/jayway/powermock/issues/370","id":97066571,"number":370,"title":"PowerMockRule not working with AbstractTransactionalJUnit4SpringContextTests","user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jayway/powermock/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/jayway/powermock/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/powermock/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-24T14:35:10Z","updated_at":"2015-07-24T14:35:45Z","closed_at":null,"body":"_From [zhaoshan...@gmail.com](https://code.google.com/u/117710579479258069090/) on October 13, 2011 17:46:33_\n\nI'm getting an exception when using PowerMockRule for a test class extending from AbstractTransactionalJUnit4SpringContextTests.\r\n\r\nThis test works:\r\n\r\n @ContextConfiguration(locations=\"/meta-inf/springtest/applicationContext.xml\")\r\n@RunWith(SpringJUnit4ClassRunner.class)  \r\n@PrepareForTest({Utils2.class})  \r\npublic class TempTest  {\r\n\t@Rule         \r\n\tpublic PowerMockRule rule = new PowerMockRule ();\r\n\t\r\n\t@Autowired\r\n    private Utils2 utils;\r\n\t\r\n    @Test\r\n    public void say() {\r\n    \tAssert.assertNotNull(this.utils);\r\n    }\r\n}\r\n\r\nThis doesn't:\r\n\r\n@ContextConfiguration(locations=\"/meta-inf/springtest/applicationContext.xml\")  \r\n@PrepareForTest({Utils2.class})  \r\npublic class TempTest  extends AbstractTransactionalJUnit4SpringContextTests {\r\n\r\n\t@Rule         \r\n\tpublic PowerMockRule rule = new PowerMockRule ();\r\n\t\r\n\t@Autowired\r\n    private Utils2 utils;\r\n\t\r\n\t//@Autowired\r\n\t// private NeighborhoodService neighborhoodService;\r\n\t\r\n    @Test\r\n    public void say() {\r\n    \t// Assert.assertNotNull(this.neighborhoodService);\r\n    \tAssert.assertNotNull(this.utils);\r\n    }\r\n}\r\n\r\nI got an exception with this stack trace:\r\n\r\ncom.thoughtworks.xstream.converters.ConversionException: javassist.NotFoundException: $Proxy4 : javassist.NotFoundException: $Proxy4\r\n---- Debugging information ----\r\nmessage             : javassist.NotFoundException: $Proxy4\r\ncause-exception     : java.lang.RuntimeException\r\ncause-message       : javassist.NotFoundException: $Proxy4\r\nclass               : java.lang.Class\r\nrequired-type       : java.lang.Class\r\nconverter-type      : com.thoughtworks.xstream.converters.SingleValueConverterWrapper\r\nwrapped-converter   : com.thoughtworks.xstream.converters.extended.JavaClassConverter\r\npath                : /org.powermock.modules.junit4.rule.PowerMockStatement$1/outer-class/fNext/fTarget/applicationContext/classLoader/classes/java-class[53]\r\nline number         : 1455\r\nclass[1]            : java.util.Vector\r\nconverter-type[1]   : com.thoughtworks.xstream.converters.collections.CollectionConverter\r\nclass[2]            : sun.misc.Launcher$AppClassLoader\r\nconverter-type[2]   : com.thoughtworks.xstream.converters.reflection.ReflectionConverter\r\nclass[3]            : org.springframework.context.support.GenericApplicationContext\r\nclass[4]            : foo.service.TempTest\r\nclass[5]            : org.junit.internal.runners.statements.InvokeMethod\r\nclass[6]            : org.powermock.modules.junit4.rule.PowerMockStatement\r\nclass[7]            : org.powermock.modules.junit4.rule.PowerMockStatement$1\r\nversion             : null\r\n\\-------------------------------\r\n\r\n...\r\n\tat org.powermock.classloading.DeepCloner.clone(DeepCloner.java:54)\r\n\tat org.powermock.classloading.ClassloaderExecutor.execute(ClassloaderExecutor.java:89)\r\n\tat org.powermock.classloading.ClassloaderExecutor.execute(ClassloaderExecutor.java:78)\r\n\tat org.powermock.modules.junit4.rule.PowerMockStatement.evaluate( PowerMockRule .java:49)\r\n\tat org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)\r\n\tat org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)\r\n\tat org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)\r\n\tat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)\r\n\r\nI'm using PowerMock 1.4.10, Javassist 3.15.0.GA, and XStream 1.4.1 on Windows 7.\r\n\r\nI also tried not extending AbstractTransactionalJUnit4SpringContextTests, but autowiring an entity object. I got a similar exception on not finding a proxy class (CGLIB enhanced).\r\n\r\nIt looks like PowerMockRule doesn't work with proxy objects.\r\n\r\nThanks!\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=350_"},"comment":{"url":"https://api.github.com/repos/jayway/powermock/issues/comments/124542996","html_url":"https://github.com/jayway/powermock/issues/370#issuecomment-124542996","issue_url":"https://api.github.com/repos/jayway/powermock/issues/370","id":124542996,"user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T14:35:45Z","updated_at":"2015-07-24T14:35:45Z","body":"_From [sandro.c...@gmail.com](https://code.google.com/u/110366065118342779578/) on June 30, 2014 14:46:38_\n\nIs this issue open yet ? I'm getting the same error =(\r\nAny news ?\r\nThanks in advance!"}}