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

Ability to specify ClassLoader to XMLDecoder.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs
    • x86
    • windows_xp



      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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: