Announcement Announcement Module
Collapse
No announcement yet.
inbound-channel + unmarshalling transformer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • inbound-channel + unmarshalling transformer

    Hi,

    I have inbound-channel-adapter polling a directory with xml files. And defined a unmarshalling-transformer for transforming the xml to java.
    It appears that the payload from the inbound channel is of type File but the jaxb unmarshaller always expects the input to be streamsource. Is there a better way to handle this, right now im overcoming this by defining a converter service between these channels ?

    This is the error without my converter

    Caused by: org.springframework.integration.core.MessagingExce ption: Failed to create Source for payload type [java.io.File]
    at org.springframework.integration.xml.source.DomSour ceFactory.createSource(DomSourceFactory.java:62)

    Thanks
    Srinivas

  • #2
    Can you try adding a "file-to-string-transformer" element (as defined in the "file" namespace) between the inbound-channel-adapter and the unmarshalling-transformer?

    Comment


    • #3
      Its working with file to string but it would have been nice if it automatically handled the file instance. saves me extra step of configuration.

      Thanks
      Srinivas

      Comment


      • #4
        Understood. Can you open a new feature request in JIRA?

        Thanks,
        Mark

        Comment


        • #5
          just did - INT-899

          Thanks for your time

          Srinivas

          Comment


          • #6
            I just committed support for File payloads. Please try this as soon as you have a chance and post back here (or in JIRA) with your results. Thanks!

            Comment

            Working...
            X