Invalid arguments...
Saturday, 22 January 2011 · 4 messages · last reply 23 Jan 2011
MB
Mark Boon22 Jan 2011 02:11 #
Just now I spent considerable time figuring out why I get a message like this:
[FORG0006] Invalid arguments for com.avatar_reality.ai.OntologyManager.save(...) method.
In case you're wondering, it doesn't have anything to do with invalid arguments. It prints this whenever anything is wrong. Anything. It could be the wrong arguments. Or the wrong method name. Or the wrong class-name. Or even better, nothing like that at all, just any uncaught exception thrown by the method (or the class-loader) will cause it to print this error.
May kindly I suggest embedding the original cause in the error message? That would save a ton of time figuring out what exactly is the matter.
Mark
AW
A. Weiler22 Jan 2011 09:50 #
Hi Mark,
if your java method isn't set to static you have to instantiate the class first and pass it to the method you want to call.
See the java binding page in our docu: http://docs.basex.org/wiki/Java_Bindings Here the FileWrite class gets instantiated with fw:new("output.txt") and then passed to the fw:write method.
Kind regards,
Andreas
Quoted text · Mark Boon · 15 lines
Am 22.01.2011 um 01:11 schrieb Mark Boon: > Just now I spent considerable time figuring out why I get a message like this: > > [FORG0006] Invalid arguments for com.avatar_reality.ai.OntologyManager.save(...) method. > > In case you're wondering, it doesn't have anything to do with invalid arguments. It prints this whenever anything is wrong. Anything. It could be the wrong arguments. Or the wrong method name. Or the wrong class-name. Or even better, nothing like that at all, just any uncaught exception thrown by the method (or the class-loader) will cause it to print this error. > > May kindly I suggest embedding the original cause in the error message? That would save a ton of time figuring out what exactly is the matter. > > Mark > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
--
Andreas Weiler
Database & Information Systems Group, U Konstanz
Room E 209, 0049 7531 88 4449 (phone) 3577 (fax)
University of Konstanz
CG
Hi Mark,
Quoted text · Mark Boon · 5 lines
> [FORG0006] Invalid arguments for > com.avatar_reality.ai.OntologyManager.save(...) method. > [...] > May kindly I suggest embedding the original cause in the error message? That > would save a ton of time figuring out what exactly is the matter.
A good point. I've revised the Java bindings to give better feedback for invocation target exceptions. As an example, the following query...
declare namespace fis = "java:java.io.FileInputStream";
fis:new("non-existing-file")…now returns:
[FORG0006] Java call failed: non-existing-file (File cannot be found).
The updated code can be found in the repository and will be part of the next minor release (to be expected in Feb).
Christian
MB
Mark Boon23 Jan 2011 20:17 #
That's great, thank you. It will save a lot of time, especially because these only turn up at run time.
Mark Boon
Quoted text · Christian Grün · 24 lines
On Jan 23, 2011, at 8:09 AM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Mark, > >> [FORG0006] Invalid arguments for >> com.avatar_reality.ai.OntologyManager.save(...) method. >> [...] >> May kindly I suggest embedding the original cause in the error message? That >> would save a ton of time figuring out what exactly is the matter. > > A good point. I've revised the Java bindings to give better feedback > for invocation target exceptions. As an example, the following > query... > > declare namespace fis = "java:java.io.FileInputStream"; > fis:new("non-existing-file") > > …now returns: > > [FORG0006] Java call failed: non-existing-file (File cannot be found). > > The updated code can be found in the repository and will be part of > the next minor release (to be expected in Feb). > > Christian
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery