{"action":"opened","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/297","labels_url":"https://api.github.com/repos/jayway/powermock/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/297/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/297/events","html_url":"https://github.com/jayway/powermock/issues/297","id":96976355,"number":297,"title":"Unit Test initialization Error when unit testing MongoDB Java Driver","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"},{"url":"https://api.github.com/repos/jayway/powermock/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-24T06:36:46Z","updated_at":"2015-07-24T06:36:46Z","closed_at":null,"body":"_From [kevin.ki...@gmail.com](https://code.google.com/u/111821237685742939965/) on September 03, 2010 14:40:49_\n\nWhat steps will reproduce the problem? 1. Create a class that uses MongoDB Java Driver v2.1\r\n2. Create a unit test for class that uses MongoDB\r\n3. Run unit test What is the expected output? What do you see instead? Test execution successful What version of the product are you using? On what operating system? Linux, powermock-mockito-1.4 Please provide any additional information below. I've attached an eclipse project that I was able to reproduce the issue with.\r\n\r\nStack Trace.\r\njava.lang.LinkageError: loader constraint violation: loader (instance of org/powermock/core/classloader/MockClassLoader) previously initiated loading for a different type with name \"javax/management/MBeanServer\"\r\n\tat java.lang.ClassLoader.defineClass1(Native Method)\r\n\tat java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)\r\n\tat java.lang.ClassLoader.defineClass(ClassLoader.java:616)\r\n\tat java.lang.ClassLoader.defineClass(ClassLoader.java:466)\r\n\tat org.powermock.core.classloader.MockClassLoader.loadUnmockedClass(MockClassLoader.java:190)\r\n\tat org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:148)\r\n\tat org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:65)\r\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:248)\r\n\tat com.mongodb.DBPortPool$Holder.get(DBPortPool.java:58)\r\n\tat com.mongodb.DBTCPConnector._set(DBTCPConnector.java:458)\r\n\tat com.mongodb.DBTCPConnector.<init>(DBTCPConnector.java:46)\r\n\tat com.mongodb.Mongo.<init>(Mongo.java:137)\r\n\tat com.mongodb.Mongo.<init>(Mongo.java:123)\r\n\tat com.mongodb.Mongo.<init>(Mongo.java:113)\n\n**Attachment:** [PowerMockError.tar.gz](http://code.google.com/p/powermock/issues/detail?id=277)\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=277_"}}