[Cosmo-dev] DOM parsers in Cosmo

Vinubalaji Gopal vinu at osafoundation.org
Wed Jul 26 17:38:23 PDT 2006


hi all,
   I was trying to use the getTextContent method (part of the dom3 api)
and was able to compile the source without maven (the source as part of
cosmo) I got the following error:

 [javac] Compiling 1 source file to /home/vinu/vinu/cosmo/target/classes
        /home/vinu/vinu/cosmo/src/main/java/org/osaf/cosmo/repository/VCardFlattener.java:107: cannot find symbol
symbol  : method getTextContent()
location: interface org.w3c.dom.Node
                    String temp = textNode.getTextContent()+ ";";

At first I thought it was a jdk problem, since I read that this method
is available only in jdk1.5 (part of dom3).

Later I found the following link to be helpful
http://forum.java.sun.com/thread.jspa?threadID=696628

It made me believe that jdk 1.5 comes with DOM 3 implementation but it
is part of the rt.jar library. Also I found that the xml parsing in
Cosmo is provided by Xerces2 (xml-api jar file, which does support DOM
3).  It took hours to find out which library was causing the problem and
finally I found that maven was
using  /usr/local/maven-1.0.2/lib/endorsed/xml-apis-1.0.b2.jar. Removing
this file solved the problem :).


While finding a solution to the problem, I found out that 
org.w3c.dom.Node is present in xml-api jar files and jtidy jar files. 
(Used the command #bash# find /home/vinu/.maven/repository/ -name *.jar
| xargs -n 1 -t jar -tvf  > output.txt)

I assume that the value of the CLASSPATH will determine the package that
will be used or is there any other way using which java finds the right
package?

#bash# maven -i
Helped me in showing the classes(partial) used by maven. 

Later I found out that
#bash# maven -X
gives lot of useful information including the complete classpath.



More information about the cosmo-dev mailing list