Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-10773

MarshalledValueInputStream cannot load an array class from specified class loader

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • EAP_EWP 5.3.0.ER1
    • EAP_EWP 5.2.0
    • System
    • None
    • Release Notes
    • Workaround Exists
    • Hide

      Preload the class in a servlet context listener

      Show
      Preload the class in a servlet context listener
    • Hide
      An NPE arising from the MarshalledValueInputStream method not being able to to load an array class with WebappClassLoader#loadClass(name) has been corrected in this release of EAP5. **DOCS NOTES** The loadClass() call has been replaced with the Class.forName(name, false, WebappClassLoader) which understands array syntax and the NPE no longer presents.
      Show
      An NPE arising from the MarshalledValueInputStream method not being able to to load an array class with WebappClassLoader#loadClass(name) has been corrected in this release of EAP5. **DOCS NOTES** The loadClass() call has been replaced with the Class.forName(name, false, WebappClassLoader) which understands array syntax and the NPE no longer presents.
    • Documented as Resolved Issue

    Description

      This is basically same issue as JBCOMMON-25, but happened in unmarshalling of a replicated http session. The class is deployed in a war file, so WebappClassLoader is responsible for loading it. In this case the allowArraySyntax workaround doesn't work.

      In the http session replication scenario, the MarshalledValueInputStream#resolveClass() tries to resolve the array class with WebappClassLoader#loadClass(name) but this call doesn't understand the array syntax form, delegate it to parents, parents don't know about the class and then a ClassNotFoundException raised.

      The loadClass() call should be replaced with the Class.forName(name, false, WebappClassLoader) which understands array syntax.

      This http session unmarshalling problem basically doesn't happen normally. This never happen once the class is loaded (cached in the class loader). So this is basically very rare situation, either 1) unfortunate timing fail-over immediately after boot or 2) active-hotstandby setup.

      Attachments

        Issue Links

          Activity

            People

              rhn-support-bmaxwell Brad Maxwell
              rhn-support-tkimura Takayoshi Kimura
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: