Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SAXParserImpl.getXMLReader error

Posted on 2004-08-10
6
Medium Priority
?
361 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 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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…
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 how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

721 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