Note that there are some explanatory texts on larger screens.

plurals
  1. POJAXB in Netbeans Module
    primarykey
    data
    text
    <p>Their Seems to be a problem when i attempt to run JAXB marshaller in a netbeans module. Originally I thought it was the node implimentation so i spent a couple of days reorganizing everything however I was still recieveing the odd error message</p> <pre><code>javax.xml.bind.JAXBException: ClassCastException: attempting to cast jar:file:/C:/Program%20Files/jmonkeyplatform/ide/modules/ext/jaxb/api/jaxb-api.jar!/javax/xml/bind/JAXBContext.class to jar:file:/C:/Program%20Files/Java/jdk1.6.0_21/jre/lib/rt.jar!/javax/xml/bind/JAXBContext.class. Please make sure that you are specifying the proper ClassLoader. at javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:96) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:205) at javax.xml.bind.ContextFinder.find(ContextFinder.java:363) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522) at com.spectre.util.JAXBImporterExporter.write(JAXBImporterExporter.java:63) </code></pre> <p>I am not exactly sure what the issue is the importer/exporter seems to work in normal projects and the importer seems to work fine when parsing the file however the export seems to cause issues. The method I use to export is </p> <pre><code> public static &lt;T&gt; void write(T savable, Class&lt;T&gt; type,Object path) { try { JAXBContext jc = JAXBContext.newInstance(type); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); if(path instanceof File) marshaller.marshal(savable, (File)path); else if(path instanceof OutputStream){ marshaller.marshal(savable, (OutputStream)path); }else throw new NoSuchMethodException("The Field Path must be of either type File or OutputStream"); } catch (NoSuchMethodException ex) { Exceptions.printStackTrace(ex); } catch (JAXBException ex) { Exceptions.printStackTrace(ex); } } </code></pre> <p>any assistance is appreciated </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload