bungeni-org / bungeni-editor

The Bungeni Editor is Drafting and Markup framework for XML production built on the OpenOffice.org platform. It supports different legislative document types (e.g hansard, bill) and supports definition of custom types, and allows markup and storage of metadata within the ODF document.
3 stars 0 forks source link

OdfDocument.save(OdfDocument <>) throws LinkageError #109

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Running the Numbering & Renumbering Code (NumberingAgent.java) correctly 
numbers/renumbers a document (based on a metadata attribute in the document 
indicating whether the document requires or renumbering)....However running 
this file from BungeniEditor (actionEvent after selecting the "Number/Renumber" 
document bt), throws a LinkageError Exception: 

>>>
Exception in thread "AWT-EventQueue-0" java.lang.LinkageError: loader 
constraint violation: loader (instance of <bootloader>) previously initiated 
loading for a different type with name "org/w3c/dom/UserDataHandler"
END

Possible cause is that org/w3c/dom/UserDataHandler is already loaded by the 
custom classloaded used for the ExternalPlugins...and trying to reload the 
class causes the error.

Possible fixes :

1. Remove references to reloaded class...hope that System.gc() kicks in before 
OdfDocument.save() runs
2. Set the contextClassLoader to the ClassLoader running sectionNumbererPanel 
(contains ActionListener for 'Number/Renumber' button)
3. ****Unload the class before running the file (write custom classLoader...?)

4. Delay the loading of the class until the 'Numbering/Renumbering' button is 
selected...delete all references soon after.

Original issue reported on code.google.com by reaganmb...@gmail.com on 6 Mar 2012 at 10:08

GoogleCodeExporter commented 9 years ago
Fixed....see r2257 
(http://code.google.com/p/bungeni-editor/source/detail?r=2257)

Original comment by reaganmb...@gmail.com on 7 Mar 2012 at 12:45