- - PR -
Xindice でのコレクションのエラー
1
投稿者 | 投稿内容 |
---|---|
|
投稿日時: 2004-03-28 17:29
Xindice 1.1b3 でJavaを使ったXUpdateを実行使用とすると、エラーが出てしまいます。
Xindice を使うのは初めてなもので、エラーに対処できません。どなたかわかる方がいらっしゃいましたら教えてください。 【エラー内容】 # java XUpdate2 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlrpc/XmlRpc at org.apache.xindice.client.xmldb.xmlrpc.DatabaseImpl.initialize(DatabaseImpl.java:182) at org.apache.xindice.client.xmldb.xmlrpc.DatabaseImpl.getCollection(DatabaseImpl.java:294) at org.apache.xindice.client.xmldb.DatabaseImple.getCollection(DatabaseImpl.java:159) at org.xmldb.apiDatabaseManager.getCollection(Unknown Sourse) at org.xmldb.apiDatabaseManager.getCollection(Unknown Sourse) at XUpdate2.main(Xupdata2.java:16) 【ソースファイル】 import org.xmldb.api.base.*; import org.xmldb.api.modules.*; import org.xmldb.api.*; /** * Simple XML:DB API example to update the database. */ public class XUpdate { public static void main(String[] args) throws Exception { Collection col = null; try { String driver = "org.apache.xindice.client.xmldb.DatabaseImpl"; Class c = Class.forName(driver); Database database = (Database) c.newInstance(); DatabaseManager.registerDatabase(database); col = DatabaseManager.getCollection("xmldb:xindice:///db/addressbook"); String xupdate = "<xu:modifications version=\"1.0\"" + " xmlns:xu=\"http://www.xmldb.org/xupdate\">" + " <xu:remove select=\"/person/phone[@type = 'home']\"/>" + " <xu:update select=\"/person/phone[@type = 'work']\">" + " 480-300-3003" + " </xu:update>" + "</xu:modifications>"; XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0"); service.update(xupdate); } catch (XMLDBException e) { System.err.println("XML:DB Exception occured " + e.errorCode + " " + e.getMessage()); } finally { if (col != null) { col.close(); } } } } 見にくくなって恐縮ですが、お願いします。 ソースコードは参照元記事に掲載されているものを使用しました。 |
|
投稿日時: 2004-03-29 11:02
はじめまして、でろんちょといいます。
次のいずれかではないかと思います。 %XINDICE_HOME%\java\libにクラスパスが通っていない %XINDICE_HOME%\java\libにxmlrpc-1.1.jarがない Webサーバ上のXindiceのlibフォルダにxmlrpc-1.1.jarがない 自分の環境は Win2K上のTomcatにWarをのっけて別フォルダにXindiceDB本体 という構成ですが、掲載ソース実行でエラーは出ませんでした. |
|
投稿日時: 2004-03-31 12:37
ありがとうございます。
CLASSPATHはきちんと設定されていたのですが、 いろいろと設定している内に何故かできていました。 御迷惑おかけしました。 |
1