Important query!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Important query!

sridevi polavaram
I developed a plugin to ImageJ. It was working fine. But I now had to import
some external framework packages in the plugin program, but for some reason
if i do that, the plugin is not recognised. The external framework that i am
using is jena.
So, can i not have any other packages imported? This plugin is of no use to
me if cannot import jena pakcages. Please let me know what can i do about
this, I thought i was almost done with my plugin until i knew about this
problem.
-Thanks
Sridevi
Reply | Threaded
Open this post in threaded view
|

Re: Important query!

ctrueden
Hi Sridevi,

Your plugin can certainly take advantage of external libraries. Just
drop the relevant JAR file(s) into the ImageJ plugins folder. If you
need more specific help, please describe your problem in more detail,
including unexpected behavior and any exact error messages.

-Curtis

On 10/18/06, sridevi polavaram <[hidden email]> wrote:

> I developed a plugin to ImageJ. It was working fine. But I now had to import
> some external framework packages in the plugin program, but for some reason
> if i do that, the plugin is not recognised. The external framework that i am
> using is jena.
> So, can i not have any other packages imported? This plugin is of no use to
> me if cannot import jena pakcages. Please let me know what can i do about
> this, I thought i was almost done with my plugin until i knew about this
> problem.
> -Thanks
> Sridevi
>
Reply | Threaded
Open this post in threaded view
|

Re: Important query!

sridevi polavaram
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
Reply | Threaded
Open this post in threaded view
|

Re: Important query!

ctrueden
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
>
Reply | Threaded
Open this post in threaded view
|

Re: Important query!

sridevi polavaram
In reply to this post by sridevi polavaram
For your information. I thought maybe since my classpath is still pointing
to JENA_HOME/*.jar i am getting this exception. So, I have changed my
classpath to IMAJE_HOME/plugins/*.jar and recompiled my LineModel.java and
copied it at IMAGEJ_HOME/plugins/ontology/examples/
and tried to run my Draw_a_Line plugin, but is still get the same
exeception:

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)
 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) .......

So the problem is due to something that i don't know about!!
-Thanks
Sri
Reply | Threaded
Open this post in threaded view
|

Re: Important query!

sridevi polavaram
In reply to this post by ctrueden
On 10/18/06, Curtis Rueden <[hidden email]> wrote:
>
> 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?


Yes, it works perfect, I have another java program that uses the same
LineModel.java which has nothing to do with ImageJ.

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:


Yes, I have changed my classpath now all the jena jars and  imagej jars are
located in  IMAGEJ_HOME folder ...please look into my previous post.

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.


Hmmm...I can try this one too

If you get the same error message that way, perhaps the problem isn't
> ImageJ-related, but rather either a bug in Jena,


No, because this other program works jsut fine!

or a coding error in
> your plugin.


possible...but where, i don't know...
Reply | Threaded
Open this post in threaded view
|

Re: Important query!

Kurt De Vos
In reply to this post by sridevi polavaram
It's a problem with your XML file you want to load.
Do a google search on the exception and you will get tons of links
kurt

On 18 Oct 2006, at 19:13, sridevi polavaram wrote:

> org.xml.sax.SAXParseException: Content is not allowed in prolog.

*--*--*--*--*--*--*--*--*--*--*--*--*--*
University of Sheffield
Academic Neurology Unit
Division of Genomic Medicine
E Floor, Medical School
Beech Hill Road
Sheffield
S10 2RX
United Kingdom

Tel: ++44 (0) 114 271 2473
Fax: ++44 (0) 114 226 1201
Email: [hidden email]
*--*--*--*--*--*--*--*--*--*--*--*--*--*
Reply | Threaded
Open this post in threaded view
|

help

Francisco Leotte | IPIMAR
Hi,

Could someone help me in the calculation of a second-order moment [u'(2,0)].

u(k,l) = SUM SUM(i,j) i^k . j^l

for k=2 and l=0

do I use for i the actual number of pixels or the actual coordinate?

I'm new to this imaging processing business, so any help into this topic
would be deeply appreciated.

Regards

Francisco Leotte

IPIMAR
Fisheries Biologist
Marine Resources Department
IPIMAR - National Fisheries Research Institute
Av. Brasília, 1449-006 Lisbon
Portugal

Tel.:  +(351) 213 027 096
Fax: +(351) 213 015 948
Mob.:   +(351) 918 991 590
E-mail: [hidden email]

*************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.
*************************************************


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Kurt
De Vos
Sent: quinta-feira, 19 de Outubro de 2006 11:57
To: [hidden email]
Subject: Re: Important query!

It's a problem with your XML file you want to load.
Do a google search on the exception and you will get tons of links
kurt

On 18 Oct 2006, at 19:13, sridevi polavaram wrote:

> org.xml.sax.SAXParseException: Content is not allowed in prolog.

*--*--*--*--*--*--*--*--*--*--*--*--*--*
University of Sheffield
Academic Neurology Unit
Division of Genomic Medicine
E Floor, Medical School
Beech Hill Road
Sheffield
S10 2RX
United Kingdom

Tel: ++44 (0) 114 271 2473
Fax: ++44 (0) 114 226 1201
Email: [hidden email]
*--*--*--*--*--*--*--*--*--*--*--*--*--*