XStream
  1. XStream
  2. XSTR-547

PureJavaReflectionProvider.instantiateUsingSerialization uses ObjectInputStream, which uses Class.forName() to resolve classes; this makes the unmarshalling process fail in multi-classloader environments, such as OSGi

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.2, 1.3
    • Fix Version/s: 1.4
    • Component/s: Converters
    • Labels:
      None

      Description

      Because PureJavaReflectionProvider.instantiateUsingSerialization uses ObjectInputStream to unmarshal objects without a no-argument constructor, it fails when the process happens in OSGi, where the ObjectInputStream class lives in one classloader, but the target class lives in another. This is because Class.forName ignores the contextClassLoader, and uses the caller class' classloader instead. This is really a JDK bug, but since we cannot expect a quick resolution of this problem at the JDK level, a workaround should be used in XStream.

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Denis Robert
        • Votes:
          1 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: