Solved

SAXParserImpl.getXMLReader error

Posted on 2004-08-10
6
360 Views
Last Modified: 2008-02-01
I have 2 methods createFile() and addInfo() methods in my program. I call createFile() and addInfo() one after the other. I am getting exception only on one of my friend's PC. Does it have to do with the environment?

Code:
--------


      /**This method creates XML file with unique name       
       *
       */
      private void createFile() {
            try {
                  File xmlMDirectory = new File(MDIR);
                  if (!xmlMDirectory.exists()) {
                        xmlMDirectory.mkdirs();
                  }

                  File file = new File(_mFileName);
                  if (!file.exists()) {
                        PrintWriter fileOut;
                        fileOut = new PrintWriter(new FileWriter(_mFileName, false));
                        fileOut.write("<?xml version=\"1.0\"?>");
                        fileOut.write("<MOP/>");
                        fileOut.close();
                  } else {
                        System.out.println("The File already exists");
                  }
            } catch (Exception e) {
                  System.err.println(e);
            }
      }

      /**This method adds the user input to XML
       *       
       */
      private void addInfo() {

            File _mopFile = new File(_mFileName);
            System.out.println("I am fine at 1");
            SAXBuilder builder = new SAXBuilder();
            System.out.println("I am fine at 2");
            Document doc;
            System.out.println("I am fine at 3");

            try {
                  doc = builder.build(_mFile); //Loading the XML into memory
                  System.out.println("I am fine at 4");
----------------------------------------------

It throws xception at " doc = builder.build(_mFile); //Loading the XML into memory"

Exception:
----------------

java.lang.AbstractMethodError: org.apache.xerces.jaxp.SAXParserImpl.getXMLReader
()Lorg/xml/sax/XMLReader;
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:295)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:464)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:445)

Thanks.
0
Comment
Question by:Joegal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 19

Accepted Solution

by:
ramazanyich earned 25 total points
ID: 11767109
Hi,
it seems llike problem occurs due yo usage of java1.4 which has included XML Parser (Apache xerces), but you are using JDom for xml parsing.
Two possibilities are available here:
1. Recompile your program before execution on your friends PC.
2. Add jdom jar files into  endorsed  directory of the JRE14 lib directory
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 25 total points
ID: 11770478
The getXMLReader () method seems to be abstract.
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 25 total points
ID: 11770499
Check what version of java both PCs have.
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question