Xindice / Java problem

  • Thread starter Christian W. Guenther
  • Start date
C

Christian W. Guenther

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.NoClassDefFoundError:
org/apache/xmlrpc/XmlRpcException
at
org.apache.xindice.client.xmldb.xmlrpc.DatabaseImpl.getCollection(DatabaseImpl.java:354)
at
org.apache.xindice.client.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:137)
at org.xmldb.api.DatabaseManager.getCollection(Unknown Source)
at org.xmldb.api.DatabaseManager.getCollection(Unknown Source)
at
com.plaengine.repository.util.XmlDbBootstrap.createCollection(XmlDbBootstrap.java:55)
at
com.plaengine.repository.util.XmlDbBootstrap.main(XmlDbBootstrap.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.xindice.client.xmldb.DatabaseImpl";
Class c = Class.forName(driver);
Database database = (Database)
c.newInstance();DatabaseManager.registerDatabase(database);
String uri = "xmldb:xindice://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.
 
C

Cybernd

Christian said:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/xmlrpc/XmlRpcException
interface, or can you think of anything I have done wrong?
Any help is more than welcome.

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

java.lang.NoClassDefFoundError => The Classloader was not able to find
one required class. In detail: he was not able to find
org.apache.xmlrpc.XmlRpcException

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top