Bugs item #1618750, was opened at 2006-12-19 13:46
Message generated for change (Tracker Item Submitted) made by Item Submitter
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.

----------------------------------------------------------------------

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

Reply via email to