Xindice / Java problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christian W. Guenther

    #1

    Xindice / Java problem

    Hallo,

    please excuse if I violate any group etiquette etc. but I am not very
    experienced both regarding the usenet and your group.

    I have installed Xindice, integrated into Tomcat, and can use it via the
    command line tools provided without problems. Yet when I try to access
    the database within a Java program I get the following error:

    trying to register database
    Exception in thread "main" java.lang.NoCla ssDefFoundError :
    org/apache/xmlrpc/XmlRpcException
    at
    org.apache.xind ice.client.xmld b.xmlrpc.Databa seImpl.getColle ction(DatabaseI mpl.java:354)
    at
    org.apache.xind ice.client.xmld b.DatabaseImpl. getCollection(D atabaseImpl.jav a:137)
    at org.xmldb.api.D atabaseManager. getCollection(U nknown Source)
    at org.xmldb.api.D atabaseManager. getCollection(U nknown Source)
    at
    com.plaengine.r epository.util. XmlDbBootstrap. createCollectio n(XmlDbBootstra p.java:55)
    at
    com.plaengine.r epository.util. XmlDbBootstrap. main(XmlDbBoots trap.java:87)

    The class XmlDbBootstrap uses code from the Xindice Website programming
    tutorial which should create a new collection within the standard root
    collection 'db'. The relevant piece of code is:

    String driver = "org.apache.xin dice.client.xml db.DatabaseImpl ";
    Class c = Class.forName(d river);
    Database database = (Database)
    c.newInstance() ;DatabaseManage r.registerDatab ase(database);
    String uri = "xmldb:xind ice://localhost:8080/db";
    col = DatabaseManager .getCollection( uri);

    The last line is exactly the point where I get the exception / crash and
    I simply cannot figure out where the problem is. When I am using the
    exact URI from the command line everything works out flawlessly.
    Are there any known bugs or pitfalls regarding Xindice or the xml:db
    interface, or can you think of anything I have done wrong?
    Any help is more than welcome.

    Thanks in advance,
    Christian



    For software versions, I have installed:
    OS: Mac OS 10.3 (Panther)
    Tomcat 5.0.27
    Xindice 1.1b4

    If you reply to me directly, please delete the 'NOSPAM.' from my adress.
  • Cybernd

    #2
    Re: Xindice / Java problem

    Christian W. Guenther wrote:
    [color=blue]
    > Exception in thread "main" java.lang.NoCla ssDefFoundError :
    > org/apache/xmlrpc/XmlRpcException[/color]
    [color=blue]
    > interface, or can you think of anything I have done wrong?
    > Any help is more than welcome.[/color]

    Learn to interprete Error Messages ;o) Thats the only importend issue.

    java.lang.NoCla ssDefFoundError => The Classloader was not able to find
    one required class. In detail: he was not able to find
    org.apache.xmlr pc.XmlRpcExcept ion

    So just add the required class to the classpath. In most cases such
    classes will be stored inside jar files. It is necessary to add such jar
    files explicitly.

    for example:
    -cp ./xmlrpc.jar

    hth
    cybi

    Comment

    Working...