{"action":"opened","issue":{"url":"https://api.github.com/repos/jayway/powermock/issues/290","labels_url":"https://api.github.com/repos/jayway/powermock/issues/290/labels{/name}","comments_url":"https://api.github.com/repos/jayway/powermock/issues/290/comments","events_url":"https://api.github.com/repos/jayway/powermock/issues/290/events","html_url":"https://github.com/jayway/powermock/issues/290","id":96975921,"number":290,"title":"SAX2 parsing -  com.sun.org.apache.xerces.internal.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader","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":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-24T06:34:03Z","updated_at":"2015-07-24T06:34:03Z","closed_at":null,"body":"_From [AlexWib...@gmail.com](https://code.google.com/u/111621038469822880271/) on July 28, 2010 08:58:48_\n\nHi all,\r\n\r\nFirst of all, my problem is probably similar to the following issue: http://groups.google.com/group/powermock/browse_thread/thread/88079512f2dfcbd1/59b5d831e3e7f9b8?pli=1 basically, I have a hibernate configuration that gets loaded in my test.\r\nI'm getting the following error:\r\n\r\n\\--------------------------------------------------\r\njava.lang.ClassCastException: com.sun.org.apache.xerces.internal.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader\r\n\tat org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:199)\r\n\tat org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:150)\r\n\tat org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)\r\n\tat org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)\r\n\tat org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)\r\n\tat org.dom4j.io.SAXReader.read(SAXReader.java:435)\r\n\r\norg.hibernate.HibernateException: Could not parse configuration: inMemory-hibernate.cfg.xml\r\n\tat org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1528)\r\n\tat org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1035)\r\n\tat org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:64)\r\n\tat org.hibernate.cfg.Configuration.configure(Configuration.java:1462)\r\n\tat org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1017)\r\n...\r\n..\r\nCaused by: org.dom4j.DocumentException: SAX2 driver class com.sun.org.apache.xerces.internal.parsers.SAXParser does not implement XMLReader Nested exception: SAX2 driver class com.sun.org.apache.xerces.internal.parsers.SAXParser does not implement XMLReader\r\n\tat org.dom4j.io.SAXReader.read(SAXReader.java:484)\r\n\tat org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1518)\r\n\t... 34 more\r\n\r\n\tat org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1518)\r\nWarning: Caught exception attempting to use SAX to load a SAX XMLReader \r\n\tat org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1035)\r\n\tat org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:64)\r\nWarning: Exception was: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader\r\n\tat org.hibernate.cfg.Configuration.configure(Configuration.java:1462)\r\nWarning: I will print the stack trace then carry on using the default SAX parser\r\n\tat org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1017)\r\n...\r\n..\r\n\\--------------------------------------\r\n\r\nI've tried the recommendation suggested in the issue I mentioned above, without any luck:\r\n\r\n\r\n\\----------------------------------\r\n\r\n@RunWith(PowerMockRunner.class)\r\n@PrepareForTest({MyServiceImpl.class})\r\n@PowerMockIgnore( { \"com.sun.org.apache.xerces.*\", \"org.dom4j.*\", \"org.xml.sax.*\" })\r\npublic class MyTest extends InMemoryLookupTests{\r\n \r\n    private MyServiceImpl service;\r\n    ...\r\n\r\n    @Before\r\n    public void setup() throws Exception {\r\n        MockitoAnnotations.initMocks(this);\r\n        service = new MyServiceImpl();\r\n        ....\r\n    }\r\n.....\r\n\r\n\r\n}\r\n\r\n\r\n\r\n\\------------------------------------\r\n\r\nCould someone please share some light?\r\n\r\nThanks in advance!\r\n\r\n\r\nRegards,\r\n\r\n\r\nAlex.\n\n_Original issue: http://code.google.com/p/powermock/issues/detail?id=270_"}}