Posted by
ctrueden on
Oct 18, 2006; 7:02pm
URL: http://imagej.273.s1.nabble.com/Important-query-tp3701275p3701281.html
Hi Sridevi,
Does your code work when ImageJ is taken out of the equation? That is,
have you developed code that interfaces successfully with Jena not as
an ImageJ plugin? Your exception trace looks like ImageJ is
successfully calling your plugin, which is calling Jena, xerxes, etc.,
but that some logical error has occurred deep within the SAX parser.
If you think it's a class loading problem, you can test by adding all
Jena JARs along with ij.jar to your classpath, then creating a main
method for your plugin:
public static void main(String[] args) {
new ImageJ(null);
String arg = ...; // my plugin arguments
new Draw_a_Line().run(arg);
}
Running this main method will automatically launch ImageJ and execute
your plugin. Not only nice for testing from the command line, but
could also help iron out any classpath issues.
If you get the same error message that way, perhaps the problem isn't
ImageJ-related, but rather either a bug in Jena, or a coding error in
your plugin.
Good luck,
Curtis
On 10/18/06, sridevi polavaram <
[hidden email]> wrote:
> Curtis,
> Thanks for responding, Inititally after importing Jena packages i didn't
> get any compilation error. But when i tried to open my plugin, I got a
> message box saying "Draw_a_Line plugin is not available"
>
> >Your plugin can certainly take advantage of external libraries. Just
> >drop the relevant JAR file(s) into the ImageJ plugins folder.
> I just did this, and this time it threw an exception like this:
>
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
> at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown
> Source)
> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
> at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:106)
> at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:197)
> at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:184)
> at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:254)
> at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:192)
> at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2044)
> at ontology.examples.LineModel.<init>(LineModel.java:30)
> at Draw_a_Line.<init>(Draw_a_Line.java:63)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>
> I have copies all the jar files from Jena/lib to Imagej/plugins folder. but
> in the exception is says (unknown source). Also as you can see in the stack
> trace all the com.hp.hpl.* packages are the Jena packages and the
> Ontology.examples.LineModel is my owl model that i want to use in my
> Draw_a_Line plugin
>
> here is the rest of the stack trace....
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at java.lang.Class.newInstance0(Unknown Source)
> at java.lang.Class.newInstance(Unknown Source)
> at ij.IJ.runUserPlugIn(IJ.java:271)
> at ij.IJ.runPlugIn(IJ.java:117)
> at ij.Executer.runPlugIn(Executer.java:171)
> at ij.Executer.runCommand(Executer.java:133)
> at ij.Executer.run(Executer.java:63)
> at java.lang.Thread.run(Unknown Source)
> com.hp.hpl.jena.shared.JenaException: rethrew: org.xml.sax.SAXParseException:
> Content is not allowed in prolog.
> at com.hp.hpl.jena.rdf.model.impl.RDFDefaultErrorHandler.fatalError(
> RDFDefaultErrorHandler.java:45)
> at com.hp.hpl.jena.rdf.arp.impl.ARPSaxErrorHandler.fatalError(
> ARPSaxErrorHandler.java:35)
> at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.warning(XMLHandler.java:214)
> at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.fatalError(XMLHandler.java:241)
> at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown
> Source)
> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
> at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:106)
> at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:197)
> at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:184)
> at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:254)
> at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:192)
> at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2044)
> at ontology.examples.LineModel.<init>(LineModel.java:30)
> at Draw_a_Line.<init>(Draw_a_Line.java:63)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at java.lang.Class.newInstance0(Unknown Source)
> at java.lang.Class.newInstance(Unknown Source)
> at ij.IJ.runUserPlugIn(IJ.java:271)
> at ij.IJ.runPlugIn(IJ.java:117)
> at ij.Executer.runPlugIn(Executer.java:171)
> at ij.Executer.runCommand(Executer.java:133)
> at ij.Executer.run(Executer.java:63)
> at java.lang.Thread.run(Unknown Source)
> Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
> at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> ... 30 more
>