You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Kim Daugaard <kd...@maerskdata.dk> on 2004/02/02 12:51:50 UTC
Re: Xindice 1.1b3 install/configuration frustrations on Windows XP
Hi Vadim,
I have tryed both copying the endorsed folder from
C:\Xindice\xindice-1.1b3\build\endorsed to
C:\j2sdk1.4.1\jre\lib\ext
and adding
-Djava.endorsed.dirs=c:\Xindice\xindice-1.1b3\build\endorsed
to C:\Xindice\xindice-1.1b3\xindice.bat
Still when I try to add a document I get this error:
C:\Xindice\xindice-1.1b3\java\examples\guide\xml>xindice ad -c
xmldb:xindice://localhost:8080/db/addressbook -f address1.xml -n address1
[DEBUG] DatabaseImpl - -Using SAX Driver: 'xerces'
[DEBUG] DatabaseImpl - -Using Service Location: '/xindice/'
[DEBUG] CollectionImpl - -Using URL: 'http://localhost:8080/xindice/'
Exception in thread "main" java.lang.NoSuchMethodError
at org.apache.xindice.tools.command.StringSerializer.startElement(StringSerializer.java:244)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xindice.tools.command.AddDocument.execute(AddDocument.java:131)
at org.apache.xindice.tools.XMLTools.execute(XMLTools.java:336)
at org.apache.xindice.tools.XMLTools.process(XMLTools.java:213)
at org.apache.xindice.tools.XMLTools.main(XMLTools.java:124)
Could it be another problem than endorsed libs?
kind regards
Kim Daugaard
Vadim Gritsenko
<vadim@reverycod To: xindice-users@xml.apache.org
es.com> cc:
Subject: Re: Xindice 1.1b3 install/configuration frustrations on Windows XP
01/30/2004 05:05
PM
Please respond
to xindice-users
Kim Daugaard wrote:
>Hi Vadim,
>
>I tried suggestion a) by copying the endorsed folder from
>
>C:\Xindice\xindice-1.1b3\build\endorsed to
>
>C:\j2sdk1.4.1\jre\lib
>
>This did not solve the problem.
>
>
Well, it should not: endorsed lib is not there. It's in
C:\j2sdk1.4.1\jre\lib\ext
>Concerning suggestion b), could you be a little more specific? Tomcat 5 has 11 .bat files in /bin
>folder. Which one and where should I put the statement -Djava.endorsed.dirs=c:\Xindice\xindice-1.1
>b3\build\endorsed?
>
>
Well, I can answer this, but it seems to me you don't need this: your
problem is with XMLTools not with Tomcat (see stacktrace). So you need
to edit bat|sh you use to start XMLTools, not Tomcat.
With Tomcat, btw, endorsed lib is located in TOMCAT_HOME/common/endorsed
Vadim
>Kim Daugaard
>
>
>
>
> Vadim Gritsenko
> <vadim@reverycod To: xindice-users@xml.apache.org
> es.com> cc:
> Subject: Re: Xindice 1.1b3 install/configuration frustrations
on Windows XP
> 01/29/2004 11:20
> PM
> Please respond
> to xindice-users
>
>
>
>
>
>
>Kim Daugaard wrote:
>
>
>
>>Hi,
>>
>>I was a little to fast stating, that the cmd line tool was working OK.
>>
>>I can add, list and delete collections, but I cannot add documents to the database:
>>
>>
>...
>
>
>>Exception in thread "main" java.lang.NoSuchMethodError
>> at
>>
>>
>org.apache.xindice.tools.command.StringSerializer.startElement(StringSerializer.java:244)
>
>
>> at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
>>
>>
>>
>
>"Endorsed Libs Problem"
>
>It can be fixed by either:
> (a) Altering JDK to use latest xerces/xalan/xml-api (shipped with xindice)
> (b) Specifing -Djava.endorsed.dirs=<directory with
>xerces/xalan/xml-api> parameter when launching java
> (c) Updating to 1.1b4-dev (this change is already done there)
>
>Vadim
>
Re: Xindice 1.1b3 install/configuration frustrations on Windows XP
Posted by Vadim Gritsenko <va...@reverycodes.com>.
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