File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes IBM XML  parser for JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "IBM XML  parser for JAVA" Watch "IBM XML  parser for JAVA" New topic

IBM XML parser for JAVA

Kavitha Chandrasekaran
Ranch Hand

Joined: Jul 24, 2002
Posts: 34
I am new to using XML in VAJ 3.5.3 environment.
I am using VAJ 3.5.3. I have imported IBM XML Parser for Java to my work bench. The example class compiles properly, but when run, I get a NoClassDefFoundError
How do I eliminate this error and run the code. Please help.

* Starts the application.
* @param args an array of command-line arguments
public static void main(java.lang.String[] args) {
Parser parser;
Document doc;
Element root;
FileInputStream FIS;
Node child,child2;
// Open the XML file passed as a parameter in memory.
FIS = new FileInputStream("d:/contacts.xml");
// Instantiating a Java based XML parser
// Passing the XML file to the XML parser
parser = new Parser("d:/contacts.xml");
doc = parser.readStream(FIS);
// Loading the memvar root with the root element in the XML tree
root = doc.getDocumentElement();
child = root.getFirstChild();

child2 = child.getNextSibling();
// Printing out the name of the root element in the XML tree
// in a DOS window
System.out.println("The Root Element is: " + root.getNodeName());
System.out.println("The First Child is: " + child.getNodeName());
System.out.println("The First Child is: " + child2.getNodeName());
// Primitive exception handling
catch (Exception excp)
System.out.println("Exception raised:" + excp.toString());
The xml file in D drive is
<?xml version="1.0" ?>
<EmpName id="eoo1" age="22">Tesr</EmpName>
<Address>D3-83 NDA</Address>
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
As this is really a question of how to configure a particular IDE, I'll move it to the IDE forum for you.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: IBM XML parser for JAVA
It's not a secret anymore!