Re: Xupdate not work! Please help me!
Andre Juffer <[email protected]> Wed, 25 Apr 2007 20:38:31 +0300
| Newsgroups | gmane.text.xml.xindice.user |
|---|---|
| Organization | The University of Oulu |
| Message-ID | <[email protected]> |
Michele, this looks like a classpath problem. When running your program, you should ensure that all required jar files are in the classpath. The error below indicates that xindice.jar (or a similar name) was not included in the classpath. Andre [email protected] wrote: > Hi, > i am a student of university. I had choosen xindice for universitary project. I had win xp, jdk 1.5, tomcat 5.5 and i had set all like instruction on apache web site. > But xupdate not work. > This is the error at command line: > > Exception in thread "main" java.lang.ClassNotFoundException: org.apache.xindice. > client.xmldb.DatabaseImpl > at java.net.URLClassLoader$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClassInternal(Unknown Source) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Unknown Source) > at PartsXupdate.main(PartsXupdate.java:10) > > > > This is my servlet: > > > import org.xmldb.api.base.*; > import org.xmldb.api.modules.*; > import org.xmldb.api.*; > > public class PartsXupdate { > 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://localhost:8080/db/esame"); > > String xupd = "<xupdate:modifications version=\"1.0\"" + > "xmlns:xupdate=http://www.xmldb.org/xupdate>" + > "<xupdate:insert-after select=\"/scheda/info/id[value='1']\">" + > "<xupdate:element name=\"commento\">Bel libro!</xupdate:element>" + > "</xupdate:insert-after>" + > "</xupdate:modifications>"; > String nome="1.xml"; > /* We are using XUpdateQueryService */ > XUpdateQueryService service = > (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0"); > > service.updateResource(nome, xupd); > } > catch (XMLDBException e) { > System.err.println("XML:DB Exception occurred " + e.errorCode); > } > finally { > if (col != null) { col.close();} > } > } > } > > Thank for help! > Bye > > > ------------------------------------------------------ > Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom > http://click.libero.it/infostrada > > > -- Andre H. Juffer | Email: [email protected] The Biocenter and | WWW: www.biochem.oulu.fi/Biocomputing/ the Dep. of Biochemistry | Fax: +358-8-553-1141 University of Oulu, Finland | Phone: +358-8-553 1161 Triacle Biocomputing | WWW: www.triacle-bc.com