Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-2888

MapToObjectTransformerParser parent-child ClassLoader issue

    XMLWordPrintable

    Details

    • Type: Defect
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.2. GA
    • Fix Version/s: 3.0 M1
    • Component/s: Core
    • Labels:
    • Environment:
      JBOSS 6

      Description

      When Spring Integration jars are located in main /lib ClassLoader and our war has its one, and we have configuration:

      <map-to-object-transformer type="com.my.proj.model.SomeModel"/>
      

      we end-up with ClassNotFoundException.
      To change it to:

      builder.getBeanDefinition().getConstructorArgumentValues().addGenericArgumentValue(type, "java.lang.Class");
      

      instead of ClassUtils#resolveClassName fixing the problem and in the end we rely on the magic of ConversionService from context on MapToObjectTransformer bean instantiation.
      As a workaround configure prototype bean of our model:

      <map-to-object-transformer ref="myModel"/>
      <bean id="myModel" class="com.my.proj.model.SomeModel" scope="prototype"/>
      

      Unfortunately I don't know how to reproduce it as test-case, but it really works on JBOSS.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abilan Artem Bilan
              Reporter:
              abilan Artem Bilan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0.25d
                  0.25d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.25d
                  0.25d