java xml db api

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

java xml db api

Bastiaan Naber
Hi,

I am a fairly new user of eXist. I have been putting XML files into the
database and I have executed all kinds of XQueries on them. Everything
went very well.

Now I want to take a look at the XML DB java api. I have tried to
execute the example:

java -jar start.jar org.exist.examples.xmldb.Retrieve [collection]
[document]

however I got this error:

************
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.exist.start.Main.invokeMain(Main.java:119)
        at org.exist.start.Main.run(Main.java:375)
        at org.exist.start.Main.main(Main.java:48)
Caused by: org.xmldb.api.base.XMLDBException: malformed url: localhost:8081
        at
org.exist.xmldb.DatabaseImpl.getRemoteCollection(DatabaseImpl.java:197)
        at org.exist.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:164)
        at org.xmldb.api.DatabaseManager.getCollection(Unknown Source)
        at org.xmldb.api.DatabaseManager.getCollection(Unknown Source)
        at org.exist.examples.xmldb.Retrieve.main(Retrieve.java:45)
************

I am not sure what this means, but I see it tries to connect to
localhost:8081, while my server runs on 8080.

I thought I might try to compile the example myself but I don't know
where to find the java packages that
I have to import. Do I need to compile these as well ?

Thanks in advance,
Bastiaan Naber


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: java xml db api

wolfgangmm
Hi,

> Caused by: org.xmldb.api.base.XMLDBException: malformed url: localhost:8081

This happens if you specify an incomplete collection path. Call the
example class with a full path for the collection, including the /db
root collection:

bin/run.sh org.exist.examples.xmldb.Retrieve /db/test hamlet.xml

The error message is indeed misleading. I fixed this.

> I thought I might try to compile the example myself but I don't know
> where to find the java packages that
> I have to import. Do I need to compile these as well ?

No. The jars you need for the client side are all in lib/core.

Wolfgang


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open