Fix issue in AbstractMethodMessageHandler

This commit is contained in:
Rossen Stoyanchev
2013-10-29 21:57:27 -04:00
parent 164a9f938c
commit a640d84961
2 changed files with 18 additions and 3 deletions

View File

@@ -438,7 +438,8 @@ public abstract class AbstractMethodMessageHandler<T>
protected void handleMatch(T mapping, HandlerMethod handlerMethod, String lookupDestination, Message<?> message) {
InvocableHandlerMethod invocable = new InvocableHandlerMethod(handlerMethod.createWithResolvedBean());
handlerMethod = handlerMethod.createWithResolvedBean();
InvocableHandlerMethod invocable = new InvocableHandlerMethod(handlerMethod);
invocable.setMessageMethodArgumentResolvers(this.argumentResolvers);
try {

View File

@@ -35,6 +35,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.SubscribableChannel;
import org.springframework.messaging.handler.annotation.MessageExceptionHandler;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.simp.config.DelegatingWebSocketMessageBrokerConfiguration;
import org.springframework.messaging.simp.config.MessageBrokerConfigurer;
@@ -70,7 +71,7 @@ public class SimpAnnotationMethodIntegrationTests extends AbstractWebSocketInteg
{new JettyWebSocketTestServer(), new JettyWebSocketClient()},
{new TomcatWebSocketTestServer(), new StandardWebSocketClient()}
});
};
}
@Override
@@ -137,6 +138,7 @@ public class SimpAnnotationMethodIntegrationTests extends AbstractWebSocketInteg
}
@SuppressWarnings("unused")
@IntegrationTestController
static class SimpleController {
@@ -146,8 +148,20 @@ public class SimpAnnotationMethodIntegrationTests extends AbstractWebSocketInteg
public void handle() {
this.latch.countDown();
}
@MessageMapping(value="/exception")
public void handleWithError() {
throw new IllegalArgumentException("Bad input");
}
@MessageExceptionHandler
public void handleException(IllegalArgumentException ex) {
}
}
@SuppressWarnings("unused")
@IntegrationTestController
static class IncrementController {
@@ -164,7 +178,7 @@ public class SimpAnnotationMethodIntegrationTests extends AbstractWebSocketInteg
private final int expected;
private final List<TextMessage> actual = new CopyOnWriteArrayList<TextMessage>();
private final List<TextMessage> actual = new CopyOnWriteArrayList<>();
private final CountDownLatch latch;