Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Complete
-
2.2.5
-
java6
Description
It is impossible to invoke any operation with any argument type being a primitive. OperationInvokingMessageHandler.handleRequestMessage() finds the correct operation, but when matching the signature, comparing arguments, it will never match primitive types.
if (value != null && value.getClass().getName().equals(paramInfo.getType())) { }
You have no possibility to pass primitive types herein:
value.getClass().getName() will return "java.lang.Boolean" not equal to paramInfo.getType() returning "boolean". The same applies to lont, int etc.
E.g. it is impossible to call stopActiveComponents of integrationMBeanExporter
...
<int:channel id="shutdownChannel" /> <int-jmx:operation-invoking-channel-adapter id="shutdownAdapter" channel="shutdownChannel" object-name="org.springframework.integration.monitor:name=integrationMBeanExporter,type=IntegrationMBeanExporter" operation-name="stopActiveComponents"/>
...
List<Object> arguments = new LinkedList<Object>(); arguments.add(true); arguments.add(0); shutdownChannel.send(MessageBuilder.withPayload(arguments).build());
Results in:
Exception in thread "Thread-1" org.springframework.integration.MessagingException: failed to find JMX operation 'stopActiveComponents' on MBean [org.springframework.integration.monitor:name=integrationMBeanExporter,type=IntegrationMBeanExporter] of type [org.springframework.integration.monitor.IntegrationMBeanExporter] with 2 parameters: [p2, p1] at org.springframework.integration.jmx.OperationInvokingMessageHandler.handleRequestMessage(OperationInvokingMessageHandler.java:154) ...