I'm using a Control Bus to send a message for invoking an operation on one of my App's services, like such:
Code:@Service public DocumentSelectorService() { public List<T extends Document> getNextSetOfDocuments(Class<T> documentType) { documentService.getDocumentByType(documentType); ... } }And then to send the message:Code:<control-bus input-channel="documentsSelectorControlChannel" /> <service-activator input-channel="documentsSelectorControlChannel" output-channel="someDownstreamChannel" expression="@documentsSelectorService.getNextSetOfDocuments(payload)" />
This works fine for all of my Unit/Integration tests. It also works on my PC running command line. However, it is failing when I deploy to our Solaris server running Solaris 10 with JRE 1.5. I am able to get it to run locally on my PC using the same 1.5 runtime as on Solaris. All environments are using Spring Framework 3.0.5 along with Spring Integration 2.0.1. The exception I'm getting is as follows:Code:public static void main(String[] args) { String payloadClass = "org.mycompany.model.SomeClass"; Message<?> operation; try { operation = MessageBuilder.withPayload(Class.forName(payloadClass)).build(); } catch (ClassNotFoundException e) { throw new IllegalArgumentException(e); } ApplicationContext ctx = new ClassPathXmlApplicationContext("META-INF/spring/application-context.xml"); DirectChannel documentsSelectorControlChannel = ctx.getBean("documentsSelectorControlChannel", DirectChannel.class); documentsSelectorControlChannel.send(operation); }
Code:INFO [org.springframework.integration.handler.LoggingHandler] - [Payload=class org.mycompany.model.SomeClass][Headers={...}] Exception in thread "main" org.springframework.integration.dispatcher.ArrgesageMessageDeliveryException: All attempts to deliver Message to MessageHandlers failed. Multiple causes: error occurred in message handler [ServiceActivator for [org.springframework.integration.handler.ExpressionCommandMessageProcessor@bcc8f4]] Expression evaluation failed: @documentsSelectorService.getNextSetOfDocuments(payload) See below for the stacktrace of the first cause. at org.springframework.integration.dispatcher.UnicastDispatcher.handleExceptions(UnicasterDispatcher.java:160) at org.springframework.integration.dispatcher.UnicastDispatcher.doDispatch(UnicasterDispatcher.java:123) at org.springframework.integration.dispatcher.UnicastDispatcher.dispatch(UnicasterDispatcher.java:97) at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubstribableChannel.java:44) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128) at org.mycompany.MainAppClass(MainAppClass.java:57) Caused by: org.springframework.integration.MessageHandlingException: error occurred in message handler [ServiceActivator for [org.springframework.integration.handler.ExpressionCommandMessageProcessor@bcc8f4]] at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:84) at org.springframework.integration.dispatcher.UnicastDispatcher.dispatch(UnicasterDispatcher.java:110) ... 5 more Caused by: java.lang.IllegalArgumentException: Message payload must be an Expression instance or an expression String. at org.springframework.integration.handler.ExpressionCommandMessageProcessor.processMessage(ExpressionCommandMessageProcessor.java:65) at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:64) at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:98) at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78) ... 6 more


Reply With Quote