Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-5188

Need to remove ImmutableListAdapter and ImmutableCollectionAdapter from our service definitions and come up with a better solution because it is producing undesirable XML

    Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-m5, 2.0
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-6474Try to come up with a better name than "CacheService"
      KULRICE-2953Rice is currently pulling in the geronimo javamail jar as an undesirable dependency from CXF, this is conflicting with sun javamail functionality
      KULRICE-13693Come up with an automated solution for link verification in the Rice portal
      KULRICE-2634Implement support for better XML export, XML import and migration features
      KULRICE-2156When pasting text from a Word document into an EDL text area, XML ends up with garbage in it.
      KULRICE-5357update our caching solution for rice.
      KULRICE-4079Add better logging
      KULRICE-5893Error messages need to be resolved on the remote services
      KULRICE-6109Come up with a way to "auto-generate" documentation on our various configuration parameters
      KULRICE-11159Come up with proposal for handling xml ingested updates
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      Currently, the ImmutableListAdapter is producing XML schema like the following (this example is from the GroupService):

      <xs:complexType name="getDirectParentGroupIdsResponse">
         <xs:sequence>
           <xs:element minOccurs="0" name="directParentGroupIds" type="ns1:anyTypeArray"/>
         </xs:sequence>
      </xs:complexType>
      

      In this case, anyTypeArray comes from the http://jaxb.dev.java.net/array schema and does not properly use the schema types from the elements of the "array". This is because this adapater is currently declared as follows:

      public class ImmutableListAdapter extends XmlAdapter<Object[], List<?>> {
          ...
      }
      

      This use of Object[] triggers the issue. Unfortunately, because of the nature of type erasure and the way that the JAXB adapter system works, there is no way to create a single, general-purpose adapter that targets the appropriate parameterized list type.

      Possible options here include:

      1. Look at the possibility introducing a custom CXF interceptor which will translate appropriately, would need to define a custom marker annotation to identify which lists/collections need to be unmodifiable
      2. Add some functionality to the KSB so that it creates it's own client-side proxies that consider immutability on list return types, would still need a custom annotation as above
      3. Create an adapter class per immutable parameterized list type and annotate using that

      Either way, the current usage of ImmutableListAdapter and ImmutableCollectionAdapter needs to be removed.

        Activity

        Hide
        Jason Whaley (Inactive) added a comment -

        Polled the cxf-user mailing list for feedback on how best to handle this.

        Thread is here: http://cxf.547215.n5.nabble.com/XmlAdapter-or-CXF-Interceptor-to-enforce-immutability-on-returned-Collections-Lists-td4462231.html

        Show
        Jason Whaley (Inactive) added a comment - Polled the cxf-user mailing list for feedback on how best to handle this. Thread is here: http://cxf.547215.n5.nabble.com/XmlAdapter-or-CXF-Interceptor-to-enforce-immutability-on-returned-Collections-Lists-td4462231.html
        Hide
        Jason Whaley (Inactive) added a comment -

        Marking resolved as of r20889 in trunk.

        Show
        Jason Whaley (Inactive) added a comment - Marking resolved as of r20889 in trunk.
        Hide
        Rice-CI User (Inactive) added a comment -

        Integrated in rice-trunk-nightly #86 (See http://ci.rice.kuali.org/job/rice-trunk-nightly/86/)
        KULRICE-5188: committing the actual interceptor used to replayce Immutable*Adapters
        KULRICE-5188: Removed Immutable*Adapters and replaced with a CXF interceptor

        Show
        Rice-CI User (Inactive) added a comment - Integrated in rice-trunk-nightly #86 (See http://ci.rice.kuali.org/job/rice-trunk-nightly/86/ ) KULRICE-5188 : committing the actual interceptor used to replayce Immutable*Adapters KULRICE-5188 : Removed Immutable*Adapters and replaced with a CXF interceptor
        Hide
        Jessica Coltrin (Inactive) added a comment -

        Closing since these items are now in the release notes.

        Show
        Jessica Coltrin (Inactive) added a comment - Closing since these items are now in the release notes.

          People

          • Assignee:
            Jason Whaley (Inactive)
            Reporter:
            Eric Westfall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Structure Helper Panel