> Matt Collins wrote: > >>I've corrected the code as you suggested, but the error remains: >> >>XML:DB Exception occured (error code: 0) >>org.xmldb.api.base.XMLDBException: Cannot communicate with the server: >>http://localhost:8080/xindice/ >> >> > > What do you seen if you go to http://localhost:8080/xindice/ with the > browser? > What is the stacktrace? >
Going to http://localhost:8080/xindice with the browser gives me the normal "ugly browser" interface after prompting me for the username/password with http basic authentication. The problem comes when I try to access the database through a Java (or flowscript) program. I translated the Java program of the previous email into flowscript, and this is the head of the stacktrace that I get: org.apache.avalon.framework.CascadingRuntimeException: "file:/usr/local/jakarta-tomcat-5.0.19/webapps/asia/forms/flow/forms.js", line 35: uncaught JavaScript exception: at add_info (file:/usr/local/jakarta-tomcat-5.0.19/webapps/asia/forms/flow/forms.js, Line 35): org.xmldb.api.base.XMLDBException: Cannot communicate with the server: http://localhost:8080/xindice/ cause: org.xmldb.api.base.XMLDBException: Cannot communicate with the server: http://localhost:8080/xindice/ full exception chain stacktrace[hide] Original Exception: org.xmldb.api.base.XMLDBException: Cannot communicate with the server: http://localhost:8080/xindice/ at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.<init>(CollectionImpl.java:168) at org.apache.xindice.client.xmldb.xmlrpc.DatabaseImpl.getCollection(DatabaseImpl.java:297) at org.apache.xindice.client.xmldb.DatabaseImpl.getCollection(DatabaseImpl.java:159) at org.xmldb.api.DatabaseManager.getCollection(Unknown Source) at org.xmldb.api.DatabaseManager.getCollection(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230) at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244) Here is the flowscript program, in case it helps (any typos are mine, I'm copying this by eye): var driver = "org.apache.xindice.client.xmldb.DatabaseImpl"; var c = java.lang.Class.forName(driver); var database = c.newInstance(); database.setProperty("xmlrpc-password", "..."); database.setProperty("xmlrpc-user", "xindice"); DatabaseManager.registerDatabase(database); var uri = "xmldb:xindice://localhost:8080/db"; col = DatabaseManager.getCollection(uri); Line 35 as mentioned in the stacktrace is the line col = DatabaseManager.getCollection(uri); As mentioned before, this flowscript code, without the setting of username/password, was working until I set the xindice directory to be password protected. Thanks for your time, Matt