Bugs item #1618750, was opened at 2006-12-19 12:46
Message generated for change (Comment added) made by shakebaby
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: shakebaby (shakebaby)
Date: 2007-08-20 03:56

Message:
Logged In: YES 
user_id=1871087
Originator: NO

I met this with the same environment.I don't know why. I guess it may be a
bug .
Can any one give me a reply please ? Thank you !

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

Comment By: Kevin Galligan (kpgalligan)
Date: 2007-03-19 00: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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
dom4j-dev mailing list
dom4j-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to