IBM Support

PM16997: UnmarshalException error may occur if a JAX-WS Web service has an @ResponseWrapper class that is not an @XmlRootElement.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following error may occur if an application invokes a
    JAX-WS Web service that has a @ResponseWrapper or
    @RequestWrapper class that is not an @XmlRootElement.
    
    [10.6.20 20.17.25:781 CEST] 0000001c ExceptionFact 1
    
    org.apache.axis2.jaxws.ExceptionFactory logRootCause
    stack:javax.xml.bind.UnmarshalException
    - with linked exception:
    [javax.xml.bind.UnmarshalException: unexpected element
    (uri:"http://sample",
    local:"myMethodResponse"). Expected elements
    are
    (...)]
    at
    com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handle
    StreamEx ception(UnmarshallerImpl.java:417)
    at
    com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Load
    er.java:
    199)
    at
    com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Load
    er.java:
    194)
    
    Note: An UnmarshalException may occur in other scenarios.  For
    example, an UnmarshalException may occur if the message
    received is invalid.  This APAR is a solution for the scenario
    when an UnmarshalException occurs and the @RequestWrapper or
    @ResponseWrapper is not an @XmlRootElement.
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  IBM WebSphere Application Server            *
    *                  Feature Pack for Web Services users or      *
    *                  administrators of JAX-WS Web services       *
    ****************************************************************
    * PROBLEM DESCRIPTION: An UnmarshalException error may occur   *
    *                      if an @ResponseWrapper is not an        *
    *                      @XmlRootElement                         *
    ****************************************************************
    * RECOMMENDATION:  Install a fix pack containing this APAR.    *
    ****************************************************************
    A JAX-WS Web service that has the "document/literal
    wrapped" style uses JAXB "wrapper" classes to marshal and
    unmarshal the XML data.  These wrapper classes are identified
    by the @RequestWrapper and @ResponseWrapper on
    the Service Endpoint Interface (SEI).
    
    Here is an example usage:
    
      @WebMethod
      @WebResult(name = "entry", targetNamespace = "http://sample")
      @RequestWrapper(localName = "findEntryByName",
           targetNamespace = "http://sample",
           className = "my.FindEntryByName"
      )
      @RespoonseWrapper(localName = "findEntryByNameResponse",
           targetNamespace = "http://sample",
           className = "my.FindEntryByNameResponse"
      )
      public AddressBookEntry findEntryByName(
            @WebParam(name = "firstname",
                targetNamespace = "http://sample")
            String firstname,
            @WebParam(name = "lastname",
                targetNamespace = "http://sample")
            String lastname);
    
    In almost all cases, the JAXB wrapper classes have an
    @XmlRootElement annotation.  This annotation indicates that
    the JAXB class represents a root element in the schema.
    
    In the failing scenario, the JAXB wrapper class has an
    @XmlType annotation but does not have an @XmlRootElement
    annotation.  In such cases, the wrapper class represents a
    root type but not a root element.
    

Problem conclusion

  • The JAX-WS runtime uses the JAXB framework to unmarshal XML
    messages.  The JAXB framework provides an alternative
    unmarshaling algorithm if the target JAXB is not a root element.
    
    The JAX-WS runtime is changed to identify wrapper beans that
    are not root elements and use the alternative JAXB
    unmarshaling algorithm.  This change avoids the
    UnmarshalException.
    
    The fix for this APAR is currently targeted for inclusion in
    fix pack 6.1.0.35.  Please refer to the Recommended Updates
    page for delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM16997

  • Reported component name

    WEBSERVIC FEATU

  • Reported component ID

    5724J0850

  • Reported release

    610

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-06-22

  • Closed date

    2010-06-30

  • Last modified date

    2010-06-30

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    PM17067

Fix information

  • Fixed component name

    WEBSERVIC FEATU

  • Fixed component ID

    5724J0850

Applicable component levels

  • R610 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
10 February 2022