Kim Daugaard wrote:

Still when I try to add a document I get this error:

Exception in thread "main" java.lang.NoSuchMethodError
at org.apache.xindice.tools.command.StringSerializer.startElement(StringSerializer.java:244)


...

Could it be another problem than endorsed libs?



Yes, it appears so that this is something else. The line in question appears to be:
244: outputXml.append(namespaceDecls);


Where both outputXml and namespaceDecls are StringBuffers.

In jdk1.4, method StringBuffer.appen(StringBuffer) was introduced, which causes backward incompatibility with jdk1.3. But I'm pretty sure that Xindice 1.1b3 was compiled with jdk1.3, so it should work with both 1.3 and 1.4. Just to be sure, I'd downloaded xml-xindice-1.1b3-jar.zip and decompiled the class to verify what method actually was used. Decompilation of the class in question shows:

public void startElement(java.lang.String,java.lang.String,java.lang.String,org.xml.sax.Attributes);
...
90: getfield #6; //Field outputXml:Ljava/lang/StringBuffer;
93: aload_0
94: getfield #11; //Field namespaceDecls:Ljava/lang/StringBuffer;
97: invokevirtual #45; //Method java/lang/StringBuffer.append:(Ljava/lang/Object;)Ljava/lang/StringBuffer;


So, StringBuffer.append(Object) was used, which is present in both 1.3 and 1.4, and should work ok on both platforms.


Then, I tried running downloaded jar release. I'd copied xindice.jar.bat from CVS version to bin/ folder of downloaded jar distribution, and copied config/ dir as well. I was able to add documents using:


   bin\xindice ac -l -c /db -n test
   bin\xindice ad -l -c /db/test -f config/system.xml -n test
   bin\xindice ad -l -c /db/test -f address1.xml -n address1
   bin\xindice ad -l -c /db/test -f address2.xml -n address2


Can you try the same? The only env variable I have is JAVA_HOME=C:\Java\j2sdk1.4.2


Vadim



Reply via email to