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

Ability to specify ClassLoader to XMLDecoder.

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description



      Name: gm110360 Date: 08/05/2002


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


      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows XP [Version 5.1.2600]

      ADDITIONAL OPERATING SYSTEMS :
      Generic feature, not relating to OS.


      A DESCRIPTION OF THE PROBLEM :
      There is no way to specify how classes are to be loaded
      when decoding an xml-format. Instead (this can be
      determined by code-inspection only) the
      Thread.getContextClassLoader() is used. This is not
      flexible enough for some situations. As a concrete example
      an EJB can not set the contextClassLoader and therefor can
      only used the class-loader set by the application-server.
      I'm sure there are other examples as well.

      My suggestion is to add a constructor for XMLDecoder that
      takes a ClassLoader as a parameter and the instance will
      use this ClassLoader to load all classes for the JavaBean
      to be decoded.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER WORKAROUND :
      The current work-around is to set the contextClassLoader
      when decoding do that every time one is decoding a
      JavaBean.
      (Review ID: 159375)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mdavidsosunw Mark Davidson (Inactive)
              Reporter:
              gmanwanisunw Girish Manwani (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: