Announcement Announcement Module
Collapse
No announcement yet.
Failed to convert argument type Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failed to convert argument type

    I am playing around with Spring Integration and developed a small project that simulates a request-response integration. I created test cases to execute the communication through local channels, JBoss MQ JMS and ActiveMQ JMS.

    The local and JBoss MQ JMS test cases execute as expected but there are intermittent exceptions (see below) when i execute the ActiveMQ JMS test.

    Code:
    27-Mar-2009 17:41:08 org.springframework.integration.handler.LoggingHandler handleMessageInternal
    SEVERE: org.springframework.integration.message.MessageHandlingException: error occurred in message handler [ServiceActivator for [org.springframework.integration.handler.MessageMappingMethodInvoker@87e704]]
            at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:54)
            at org.springframework.integration.endpoint.PollingConsumer.doPoll(PollingConsumer.java:59)
            at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.innerPoll(AbstractPollingEndpoint.java:232)
            at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.poll(AbstractPollingEndpoint.java:216)
            at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:209)
            at org.springframework.integration.scheduling.SimpleTaskScheduler$ErrorHandlingRunnableWrapper.run(SimpleTaskScheduler.java:307)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
            at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
            at org.springframework.integration.scheduling.SimpleTaskScheduler$TriggeredTask.run(SimpleTaskScheduler.java:256)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
            at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.IllegalArgumentException: Failed to convert argument type.
            at org.springframework.integration.util.DefaultMethodInvoker.invokeMethod(DefaultMethodInvoker.java:81)
            at org.springframework.integration.handler.MessageMappingMethodInvoker.doInvokeMethod(MessageMappingMethodInvoker.java:132)
            at org.springframework.integration.handler.MessageMappingMethodInvoker.invokeMethod(MessageMappingMethodInvoker.java:100)
            at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:49)
            at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:90)
            at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:48)
            ... 12 more
    Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type [org.springframework.integration.message.GenericMessage] to required type [ie.springit.eai.loanbroker.model.LoanApplication]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.integration.message.GenericMessage] to required type [ie.springit.eai.loanbroker.model.LoanApplication]: no matching editors or conversion strategy found
            at org.springframework.beans.SimpleTypeConverter.convertIfNecessary(SimpleTypeConverter.java:50)
            at org.springframework.beans.SimpleTypeConverter.convertIfNecessary(SimpleTypeConverter.java:41)
            at org.springframework.integration.util.DefaultMethodInvoker.invokeMethod(DefaultMethodInvoker.java:78)
            ... 17 more
    Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.integration.message.GenericMessage] to required type [ie.springit.eai.loanbroker.model.LoanApplication]: no matching editors or conversion strategy found
            at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
            at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:107)
            at org.springframework.beans.SimpleTypeConverter.convertIfNecessary(SimpleTypeConverter.java:47)
            ... 19 more
    I have attached a maven project with dependencies and test cases to recreate the problem. Anyone any ideas?

  • #2
    I reproduced described behavior on my machine with an embedded amq broker. I haven't debugged this yet, but it smells like a concurrency issue to me. Could you log an issue in JIRA for this?

    Comment


    • #3
      Raised JIRA http://jira.springframework.org/browse/INT-620

      Comment


      • #4
        Thank you for submitting the issue. We are looking into it.

        Comment


        • #5
          I believe I discovered the problem, and that it is a simple configuration issue. I described it in a comment on the JIRA issue: http://jira.springframework.org/browse/INT-620

          Please verify my assertion there, and let me know if it's working for you (it does work for me).

          Regards,
          Mark

          Comment

          Working...
          X