Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-255

[PATCH] ResolverUtil may cause an NPE to be thrown and caught in its static initialization block

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: Version 2, Version 2.1
    • Fix Version/s: TBD
    • Component/s: None
    • Labels:
      None

      Description

      org.apache.xmlbeans.impl.common.ResolverUtil may cause an NPE to be thrown and caught in its static initialization block if the System property "xmlbean.entityResolver" is not set.

      I noticed this whilst debugging Geronimo in Eclipse with a breakpoint on NullPointerExceptions being thrown/caught.

      I will attach a patch that will prevent the NullPointerException being unnecessarily being thrown/caught.

      Thread [http-0.0.0.0-8080-Processor25] (Suspended (exception java.lang.NullPointerException))
      org.apache.xmlbeans.impl.common.ResolverUtil.<clinit>() line: 34
      org.apache.xmlbeans.impl.store.Locale.getSaxLoader(org.apache.xmlbeans.XmlOptions) line: 3010
      org.apache.xmlbeans.impl.store.Locale.parse(java.lang.String, org.apache.xmlbeans.SchemaType, org.apache.xmlbeans.XmlOptions) line: 703
      org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(java.lang.String, org.apache.xmlbeans.SchemaType, org.apache.xmlbeans.XmlOptions) line: 687
      org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(org.apache.xmlbeans.SchemaTypeLoader, java.lang.String, org.apache.xmlbeans.SchemaType, org.apache.xmlbeans.XmlOptions) line: 674
      org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl(org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase).parse(java.lang.String, org.apache.xmlbeans.SchemaType, org.apache.xmlbeans.XmlOptions) line: 208
      org.apache.xmlbeans.XmlObject$Factory.parse(java.lang.String, org.apache.xmlbeans.XmlOptions) line: 632
      org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil.parse(java.lang.String) line: 92
      org.apache.geronimo.j2ee.deployment.EARConfigBuilder.getEarPlan(java.io.File, java.util.jar.JarFile) line: 173
      <SNIP>

        Attachments

        1. XMLBEANS-255.patch
          0.8 kB
          John Sisson

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              johnrsisson John Sisson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: