Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SAXParserImpl.getXMLReader error

Posted on 2004-08-10
6
Medium Priority
?
362 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
6 Comments
 
LVL 19

Accepted Solution

by:
ramazanyich earned 100 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 100 total points
ID: 11770478
The getXMLReader () method seems to be abstract.
0
 
LVL 35

Assisted Solution

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

885 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