Bugs item #1618750, was opened at 2006-12-19 07:46 Message generated for change (Comment added) made by kpgalligan You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116035&aid=1618750&group_id=16035
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andre Nurzenski (nurzensa) Assigned to: Nobody/Anonymous (nobody) Summary: ClassCastException while creating org.dom4j.DocumentFactory Initial Comment: I am using dom4j 1.6.1 within an OSGi-Bundle in a rich client application. When running the application, the following call causes a DocumentException: SAXReader saxReader = new SAXReader(); Document document = saxReader.read(InputStream); The DocumentException contains a nested ClassCastException: java.lang.ClassCastException: org.dom4j.DocumentFactory at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97) at org.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645) at org.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969) at org.dom4j.io.SAXReader.read(SAXReader.java:449) at org.dom4j.io.SAXReader.read(SAXReader.java:343) The cause of this exception seems to be the way the DocumentFactory class is loaded in org.dom4j.util.SimpleSingleton, line 38, using the context class loader. When using Class.forName() to load the class (same way as in 1.6), the problem does not occur. As this seems to be a very special problem within an OSGi-Environment and its class loading mechanism, I'm not sure if this issue can be considered as a bug. Please contact me if you need further information. ---------------------------------------------------------------------- Comment By: Kevin Galligan (kpgalligan) Date: 2007-03-18 20:46 Message: Logged In: YES user_id=102538 Originator: NO I'm having the same problem. Just started out of nowhere. I had installed jdk1.6, then tried to uninstall it and put 1.5 back, and ever since that happened there have been problems. My code was working before, though, so this is a little frustrating. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116035&aid=1618750&group_id=16035 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ dom4j-dev mailing list dom4j-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-dev