Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1263

Couldn´t reset SAXParser on AIX

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 2.9.0
    • None
    • SAX
    • None
    • Classic VM (build 1.4.2, J2RE 1.4.2 IBM AIX build ca142-20060421 (SR5) (JIT enabled: jitc))
      AIX Version 5.3
      AIX Kernel Version 5.3.0.54
      Processor - PowerPC_POWER5 64 bit

    Description

      On AIX I get this Error:
      java -jar xerctest.jar /bea/wls/IPMRS_FFMS_BMD_000001_01.20070424105446
      Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xerces.parsers.XML11Configuration: method getFeature0(Ljava/lang/String;)Z not found
      at org.apache.xerces.parsers.XIncludeAwareParserConfiguration.getFeature(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.reset(Unknown Source)
      at xerc.XercTest.doSyntaxCheck(XercTest.java:50)
      at xerc.XercTest.main(XercTest.java:30)

      On another machine, like Suse Linux Enterprise Server 9 the code works fine, here is the snipplet that doesn´t work

      package xerc;

      import java.io.File;
      import java.io.IOException;
      import java.net.URL;

      import org.apache.xerces.parsers.SAXParser;
      import org.apache.xerces.parsers.XIncludeAwareParserConfiguration;
      import org.apache.xerces.xni.parser.XMLInputSource;
      import org.xml.sax.SAXException;

      public class XercTest {

      private XIncludeAwareParserConfiguration parserConfig;
      private SAXParser parser;

      public static void main( String [] args )

      { XercTest tBmd = new XercTest(); tBmd.doSyntaxCheck(args[0]); }

      public void doSyntaxCheck(String filename ) {
      try

      { parserConfig = new XIncludeAwareParserConfiguration(); parser = new SAXParser(parserConfig); parserConfig.setInputSource(new XMLInputSource(null, filename, null)); parser.setFeature("http://xml.org/sax/features/validation", true); parser.setFeature("http://apache.org/xml/features/validation/schema", true); parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",true); URL schemaUrl = this.getClass().getResource("IPMRS_FFMS_Schema.xsd"); String url = schemaUrl.toString().replaceAll(" ", "%20"); parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", url); parser.reset(); // ..... }

      catch(IOException e)

      { e.printStackTrace(); } catch(SAXException e) { e.printStackTrace(); }

      // .....
      File file = new File(filename);
      String fileName = file.getName();

      String source, target, dataType, seqStr, pnStr, dtmStr;
      long seq = -1;
      int pn = -1;

      source = fileName.substring(0, 5);
      target = fileName.substring(6, 10);
      dataType = fileName.substring(11, 14);
      seqStr = fileName.substring(15, 21);
      pnStr = fileName.substring(22, 24);
      dtmStr = fileName.substring(25, fileName.length());

      try

      { parserConfig.parse(true); }

      catch(IOException e)

      { e.printStackTrace(); }

      System.out.println("XercTest.doSyntaxCheck()");
      }
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            hardyloppmann Hardy Loppmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: