Dear BaseXes,
i'm attempting to use the published API from Java (well Scala, really, but we're all JVM family, here...). i'm running into an abstract method error (see the trace below). Any clues would be gratefully appreciated.
Best wishes,
--greg
scala> val db = Class.forName( "org.basex.api.xmldb.BXDatabase" ).newInstance().asInstanceOf[Database] val db = Class.forName( "org.basex.api.xmldb.BXDatabase" ).newInstance().asInstanceOf[Database] db: org.xmldb.api.base.Database = org.basex.api.xmldb.BXDatabase@69dbb4d1
scala> DatabaseManager.registerDatabase( db ) DatabaseManager.registerDatabase( db ) java.lang.AbstractMethodError: org.basex.api.xmldb.BXDatabase.getNames()[Ljava/lang/String; at org.xmldb.api.DatabaseManager.registerDatabase(Unknown Source) at .<init>(<console>:25) at .<clinit>(<console>) at RequestResult$.<init>(<console>:9) at RequestResult$.<clinit>(<console>) at RequestResult$scala_repl_result(<console>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at scala.tools.nsc.Interpreter$Request$$anonfun$loadAndRun$1$$anonfun$apply$17.apply(Interpreter.scala:988) at scala.tools.nsc.Interpreter$Request$$anonfun$loadAndRun$1$$a... scala>
Greg,
BaseX comes with a xmldb-api-1.0.jar. Are you using this jar? It looks like you are using a different jar for the XML:DP API, probably a newer version. The BXDatabase class form BaseX doesn't support getNames(). The DatabaseManager is calling this method. I have the impression that the xmldb-api-1.0.jar that comes with BaseX is an older version of the XML:DB API. A version that relies on getName() instead of getNames().
Regards, Frans
Op 29 mrt 2011, om 23:20 heeft Meredith Gregory het volgende geschreven:
Dear BaseXes,
i'm attempting to use the published API from Java (well Scala, really, but we're all JVM family, here...). i'm running into an abstract method error (see the trace below). Any clues would be gratefully appreciated.
Best wishes,
--greg
scala> val db = Class.forName( "org.basex.api.xmldb.BXDatabase" ).newInstance().asInstanceOf[Database] val db = Class.forName( "org.basex.api.xmldb.BXDatabase" ).newInstance().asInstanceOf[Database] db: org.xmldb.api.base.Database = org.basex.api.xmldb.BXDatabase@69dbb4d1
scala> DatabaseManager.registerDatabase( db ) DatabaseManager.registerDatabase( db ) java.lang.AbstractMethodError: org.basex.api.xmldb.BXDatabase.getNames()[Ljava/lang/String; at org.xmldb.api.DatabaseManager.registerDatabase(Unknown Source) at .<init>(<console>:25) at .<clinit>(<console>) at RequestResult$.<init>(<console>:9) at RequestResult$.<clinit>(<console>) at RequestResult$scala_repl_result(<console>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at scala.tools.nsc.Interpreter$Request$$anonfun$loadAndRun$1$$anonfun$apply$17.apply(Interpreter.scala:988) at scala.tools.nsc.Interpreter$Request$$anonfun$loadAndRun$1$$a... scala>
-- L.G. Meredith Managing Partner Biosimilarity LLC 7329 39th Ave SW Seattle, WA 98136
+1 206.650.3740
http://biosimilarity.blogspot.com
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Dear Frans,
Thanks for the quick response! i was groveling through the code and coming to the same conclusion.
Best wishes,
--greg
On Tue, Mar 29, 2011 at 2:35 PM, frans@planet frans-de-boer@planet.nlwrote:
Greg,
BaseX comes with a xmldb-api-1.0.jar. Are you using this jar? It looks like you are using a different jar for the XML:DP API, probably a newer version. The BXDatabase class form BaseX doesn't support getNames(). The DatabaseManager is calling this method. I have the impression that the xmldb-api-1.0.jar that comes with BaseX is an older version of the XML:DB API. A version that relies on getName() instead of getNames().
Regards, Frans
Op 29 mrt 2011, om 23:20 heeft Meredith Gregory het volgende geschreven:
Dear BaseXes,
i'm attempting to use the published API from Java (well Scala, really, but we're all JVM family, here...). i'm running into an abstract method error (see the trace below). Any clues would be gratefully appreciated.
Best wishes,
--greg
scala> val db = Class.forName( "org.basex.api.xmldb.BXDatabase" ).newInstance().asInstanceOf[Database] val db = Class.forName( "org.basex.api.xmldb.BXDatabase" ).newInstance().asInstanceOf[Database] db: org.xmldb.api.base.Database = org.basex.api.xmldb.BXDatabase@69dbb4d1
scala> DatabaseManager.registerDatabase( db ) DatabaseManager.registerDatabase( db ) java.lang.AbstractMethodError: org.basex.api.xmldb.BXDatabase.getNames()[Ljava/lang/String; at org.xmldb.api.DatabaseManager.registerDatabase(Unknown Source) at .<init>(<console>:25) at .<clinit>(<console>) at RequestResult$.<init>(<console>:9) at RequestResult$.<clinit>(<console>) at RequestResult$scala_repl_result(<console>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at scala.tools.nsc.Interpreter$Request$$anonfun$loadAndRun$1$$anonfun$apply$17.apply(Interpreter.scala:988) at scala.tools.nsc.Interpreter$Request$$anonfun$loadAndRun$1$$a... scala>
-- L.G. Meredith Managing Partner Biosimilarity LLC 7329 39th Ave SW Seattle, WA 98136
+1 206.650.3740
http://biosimilarity.blogspot.com
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Dear Greg, dear Frans,
you might as well be interested in using our own API - the examples [1] are straight forward, many of our users feel it's comfortable to use. I do not know what you are working on and whether you rely on xmldb-api a lot, it might be worth a quick look anyway.
But back to your issue: Seems you are right, it really looks like the String[] getNames() method was introduced to replace String getName(). I will see if this can easily be fixed, I am not really into xmldb-api, but if the getName[s]() method is the only difference between our version and the latest version from 11/11/2011 [2] this should not be too hard.
Thanks for reporting and sorry for the inconvenience.
Kind Regards Michael
[1] http://docs.basex.org/wiki/Code_Examples (QueryExample, RunCommands) [1.1] http://docs.basex.org/wiki/XMLDBQuery has an example for xmldb usage [2] http://sourceforge.net/projects/xmldb-org/files/xapi/api/
Am 29.03.2011 um 23:37 schrieb Meredith Gregory:
Dear Frans,
Thanks for the quick response! i was groveling through the code and coming to the same conclusion.
Best wishes,
--greg
Dear Micheal,
Thanks for your response! i've had a little more luck with your api. However, i've got a small problem regarding database isolation.
If i have two different collections which i created from your Java api (using the XMLDBCreate.java as the template -- but using separate URI's) and query them from the GUI, i get back results specific to those collections. However, if i query from the Java api (using the XMLDBQuery.java as the template) the query runs over both collections. So, results are not isolated to the databases in which they reside. Is there a way to just query the database/collection of interest?
Also, of interest, when i used the Java api to create an XMLResource, set it's content to the XML listed below and then store the resource, the file structure is stored but the values at the leaves are lost. That is the strings in the elements String are null'd out.
Best wishes,
--greg
<?xml version="1.0" encoding="UTF-8"?> <Connected xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:/Users/lgm/work/src/projex/biosimilarity/graphatrope/src/main/bnfc/GraphL.xsd"> <EdgeName> <EdgeString> <String value="Bridge"/> </EdgeString>
</EdgeName> <VertexSelection> <Connected> <EdgeName> <EdgeString> <String value="TroubleWater"/> </EdgeString>
</EdgeName> <VertexSelection> <Isolated> <Pointed> <VertexString> <String value="Black"/> </VertexString>
</Pointed> <Pointed> <VertexString> <String value="White"/> </VertexString>
</Pointed> </Isolated> </VertexSelection> <VertexSelection> <Pointed> <VertexString> <String value="Red"/> </VertexString>
</Pointed> </VertexSelection> </Connected> </VertexSelection> <VertexSelection> <Pointed> <VertexString> <String value="Yellow"/> </VertexString>
</Pointed> </VertexSelection> </Connected>
On Tue, Mar 29, 2011 at 3:44 PM, Michael Seiferle < michael.seiferle@uni-konstanz.de> wrote:
Dear Greg, dear Frans,
you might as well be interested in using our own API - the examples [1] are straight forward, many of our users feel it's comfortable to use. I do not know what you are working on and whether you rely on xmldb-api a lot, it might be worth a quick look anyway.
But back to your issue: Seems you are right, it really looks like the String[] getNames() method was introduced to replace String getName(). I will see if this can easily be fixed, I am not really into xmldb-api, but if the getName[s]() method is the only difference between our version and the latest version from 11/11/2011 [2] this should not be too hard.
Thanks for reporting and sorry for the inconvenience.
Kind Regards Michael
[1] http://docs.basex.org/wiki/Code_Examples (QueryExample, RunCommands) [1.1] http://docs.basex.org/wiki/XMLDBQuery has an example for xmldb usage [2] http://sourceforge.net/projects/xmldb-org/files/xapi/api/
Am 29.03.2011 um 23:37 schrieb Meredith Gregory:
Dear Frans,
Thanks for the quick response! i was groveling through the code and
coming to the same conclusion.
Best wishes,
--greg
Dear Micheal,
My apologies! i was able to demonstrate to myself that both behaviors were due to errors on my part.
Best wishes,
--greg
On Tue, Mar 29, 2011 at 4:44 PM, Meredith Gregory lgreg.meredith@gmail.comwrote:
Dear Micheal,
Thanks for your response! i've had a little more luck with your api. However, i've got a small problem regarding database isolation.
If i have two different collections which i created from your Java api (using the XMLDBCreate.java as the template -- but using separate URI's) and query them from the GUI, i get back results specific to those collections. However, if i query from the Java api (using the XMLDBQuery.java as the template) the query runs over both collections. So, results are not isolated to the databases in which they reside. Is there a way to just query the database/collection of interest?
Also, of interest, when i used the Java api to create an XMLResource, set it's content to the XML listed below and then store the resource, the file structure is stored but the values at the leaves are lost. That is the strings in the elements String are null'd out.
Best wishes,
--greg
<?xml version="1.0" encoding="UTF-8"?>
<Connected xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:/Users/lgm/work/src/projex/biosimilarity/graphatrope/src/main/bnfc/GraphL.xsd"> <EdgeName> <EdgeString> <String value="Bridge"/> </EdgeString>
</EdgeName> <VertexSelection> <Connected> <EdgeName> <EdgeString> <String value="TroubleWater"/> </EdgeString> </EdgeName> <VertexSelection> <Isolated> <Pointed> <VertexString> <String value="Black"/> </VertexString> </Pointed> <Pointed> <VertexString> <String value="White"/> </VertexString> </Pointed> </Isolated> </VertexSelection> <VertexSelection> <Pointed> <VertexString> <String value="Red"/> </VertexString> </Pointed> </VertexSelection> </Connected> </VertexSelection> <VertexSelection> <Pointed> <VertexString> <String value="Yellow"/> </VertexString> </Pointed> </VertexSelection>
</Connected>
On Tue, Mar 29, 2011 at 3:44 PM, Michael Seiferle < michael.seiferle@uni-konstanz.de> wrote:
Dear Greg, dear Frans,
you might as well be interested in using our own API - the examples [1] are straight forward, many of our users feel it's comfortable to use. I do not know what you are working on and whether you rely on xmldb-api a lot, it might be worth a quick look anyway.
But back to your issue: Seems you are right, it really looks like the String[] getNames() method was introduced to replace String getName(). I will see if this can easily be fixed, I am not really into xmldb-api, but if the getName[s]() method is the only difference between our version and the latest version from 11/11/2011 [2] this should not be too hard.
Thanks for reporting and sorry for the inconvenience.
Kind Regards Michael
[1] http://docs.basex.org/wiki/Code_Examples (QueryExample, RunCommands) [1.1] http://docs.basex.org/wiki/XMLDBQuery has an example for xmldb usage [2] http://sourceforge.net/projects/xmldb-org/files/xapi/api/
Am 29.03.2011 um 23:37 schrieb Meredith Gregory:
Dear Frans,
Thanks for the quick response! i was groveling through the code and
coming to the same conclusion.
Best wishes,
--greg
-- L.G. Meredith Managing Partner Biosimilarity LLC 7329 39th Ave SW Seattle, WA 98136
+1 206.650.3740
Michael,
I am using Orbeon Forms (version 3.8.0). Out of the box it comes with eXist (version 1.2.6). I'm trying out wether it is possible to use another xml-database as backend, in particularly Sedna and BaseX. Orbeon comes with a so-called xmldb-processor. That processor leans heavily on eXist, making it impossible to use it with Sedna or BaseX. So, I'm writing my own xmldb-processor. I'm bound to the version of the xmldb-api that comes with eXist. Even if I use another database as backend, Orbeon will use eXist for storing some data. I'm not sure what version of the xmldb-api eXist uses. The only thing I know for sure is that they don't use the latest version. You can browse the code at http://xmldb-org.cvs.sourceforge.net/viewvc/xmldb-org/xapi/src/.
To use BaseX as backend I have changed three classes in the basex-api. I have attached the source-code of those classes and the xmldb-api that comes with eXist 1.2.6.
I made the following changes:
BXDatabase - I added the method getNames()
BXQueryService - I added an import of org.xmldb.api.base.CompiledExpression; - I added an import of org.xmldb.api.modules.XQueryService; - I added XQueryService to the implements-clause of the class - I changed the value of the constant XQUERY from "XQueryQueryService" to "XQueryService" - I added the method compile(): it throws XMLDBException - I added the method execute(): it throws XMLDBException - I added the method setXPathCompatibility(); it does nothing - I added the method setModuleLoadPath(); it does nothing - I added the method declareVariable(): it throws XMLDBException
BXXMLResource - I added an import of org.xml.sax.SAXNotRecognizedException; - I added an import of org.xml.sax.SAXNotSupportedException; - I added the method setSAXFeature(): it throws SAXNotSupportedException - I added the method getSAXFeature(): it throws SAXNotSupportedException
Regards, Frans
Op 30 mrt 2011, om 00:44 heeft Michael Seiferle het volgende geschreven:
Dear Greg, dear Frans,
you might as well be interested in using our own API - the examples [1] are straight forward, many of our users feel it's comfortable to use. I do not know what you are working on and whether you rely on xmldb-api a lot, it might be worth a quick look anyway.
But back to your issue: Seems you are right, it really looks like the String[] getNames() method was introduced to replace String getName(). I will see if this can easily be fixed, I am not really into xmldb-api, but if the getName[s]() method is the only difference between our version and the latest version from 11/11/2011 [2] this should not be too hard.
Thanks for reporting and sorry for the inconvenience.
Kind Regards Michael
[1] http://docs.basex.org/wiki/Code_Examples (QueryExample, RunCommands) [1.1] http://docs.basex.org/wiki/XMLDBQuery has an example for xmldb usage [2] http://sourceforge.net/projects/xmldb-org/files/xapi/api/
Am 29.03.2011 um 23:37 schrieb Meredith Gregory:
Dear Frans,
Thanks for the quick response! i was groveling through the code and coming to the same conclusion.
Best wishes,
--greg
Hi Frans,
thanks for your detailed explanations. Quite interesting work you are doing here. XForms and implementations have also been quite a topic at XML Prague last week :-)
The files you sent are looking fine, thank you. During the weekend I will see whether they compile against the latest xmldb-api.jar found on Sourceforge and integrate them in BaseX. But I need to talk this over with the other team members beforehand, maybe we compiled against the older for reasons I don't know yet.
Thanks again Michael
Am 30.03.2011 um 23:40 schrieb frans@planet:
Michael,
I am using Orbeon Forms (version 3.8.0). Out of the box it comes with eXist (version 1.2.6). I'm trying out wether it is possible to use another xml-database as backend, in particularly Sedna and BaseX. Orbeon comes with a so-called xmldb-processor. That processor leans heavily on eXist, making it impossible to use it with Sedna or BaseX. So, I'm writing my own xmldb-processor. I'm bound to the version of the xmldb-api that comes with eXist. Even if I use another database as backend, Orbeon will use eXist for storing some data. I'm not sure what version of the xmldb-api eXist uses. The only thing I know for sure is that they don't use the latest version. You can browse the code at http://xmldb-org.cvs.sourceforge.net/viewvc/xmldb-org/xapi/src/.
To use BaseX as backend I have changed three classes in the basex-api. I have attached the source-code of those classes and the xmldb-api that comes with eXist 1.2.6.
<BXDatabase.java><BXQueryService.java><BXXMLResource.java><exist-xmldb.jar>
I made the following changes:
BXDatabase
- I added the method getNames()
BXQueryService
- I added an import of org.xmldb.api.base.CompiledExpression;
- I added an import of org.xmldb.api.modules.XQueryService;
- I added XQueryService to the implements-clause of the class
- I changed the value of the constant XQUERY from "XQueryQueryService" to "XQueryService"
- I added the method compile(): it throws XMLDBException
- I added the method execute(): it throws XMLDBException
- I added the method setXPathCompatibility(); it does nothing
- I added the method setModuleLoadPath(); it does nothing
- I added the method declareVariable(): it throws XMLDBException
BXXMLResource
- I added an import of org.xml.sax.SAXNotRecognizedException;
- I added an import of org.xml.sax.SAXNotSupportedException;
- I added the method setSAXFeature(): it throws SAXNotSupportedException
- I added the method getSAXFeature(): it throws SAXNotSupportedException
Regards, Frans
Op 30 mrt 2011, om 00:44 heeft Michael Seiferle het volgende geschreven:
Dear Greg, dear Frans,
you might as well be interested in using our own API - the examples [1] are straight forward, many of our users feel it's comfortable to use. I do not know what you are working on and whether you rely on xmldb-api a lot, it might be worth a quick look anyway.
But back to your issue: Seems you are right, it really looks like the String[] getNames() method was introduced to replace String getName(). I will see if this can easily be fixed, I am not really into xmldb-api, but if the getName[s]() method is the only difference between our version and the latest version from 11/11/2011 [2] this should not be too hard.
Thanks for reporting and sorry for the inconvenience.
Kind Regards Michael
[1] http://docs.basex.org/wiki/Code_Examples (QueryExample, RunCommands) [1.1] http://docs.basex.org/wiki/XMLDBQuery has an example for xmldb usage [2] http://sourceforge.net/projects/xmldb-org/files/xapi/api/
Am 29.03.2011 um 23:37 schrieb Meredith Gregory:
Dear Frans,
Thanks for the quick response! i was groveling through the code and coming to the same conclusion.
Best wishes,
--greg
basex-talk@mailman.uni-konstanz.de