Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4667730

spring-02 JAXP now has ClassCastException when reading XML file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • java_xml_pack
    • xml



      Name: gm110360 Date: 04/12/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)


      FULL OPERATING SYSTEM VERSION :
      Windows 98 [Version 4.10.2222]


      A DESCRIPTION OF THE PROBLEM :
      This is really against the Spring-02 pack, which
      astoundingly hasn't made it to the Product Version dropdown
      list of this form.

      The new and improved JAXP classes cause a ClassCastException
      when reading an XML file. Specifically, an importPreferences
      call on an XML file created in the Forte IDE, listed
      below, causes an exception, also listed below. The old
      and unimproved version of JAXP worked fine.

      xerces.jar is in jre\lib\endorsed.


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.ClassCastException: org.apache.xerces.dom.DeferredCommentImpl
              at java.util.prefs.XmlSupport.importPreferences(XmlSupport.java:182)
              at java.util.prefs.Preferences.importPreferences(Preferences.java:1138)
              at com.rockyboat.lib.XuWelcome.<init>(XuWelcome.java:92)
              at com.rockyboat.scripter.Scripter.initComponents(Scripter.java:60)
              at com.rockyboat.scripter.Scripter.<init>(Scripter.java:40)
              at com.rockyboat.scripter.Scripter.main(Scripter.java:121)

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd&#39;>

      <preferences EXTERNAL_XML_VERSION="1.0">
        <root type="user">
          <map />
          <node name="com">
            <map />
            <node name="rockyboat">
              <map />
              <node name="lib">
                <map>
                  <entry key="XU_RECENT" value="0" />
                  <entry key="OPT_YN_SHOW_XUS" value="y" />
                </map>
              </node>
            </node>
          </node>
        </root>
      </preferences>


      ---------- END SOURCE ----------
      (Review ID: 144778)
      ======================================================================

            nbajajsunw Neeraj Bajaj (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: