Spring annotation problem


Is it not possible to combine @CommandHandler and @PreAuthorize(...)
annotations on a method?

When I do, I get a

java.lang.ClassFormatError: Duplicate method name&signature in class
file no/origin/axon/TestCommandHandler$$EnhancerByCGLIB$$ff55cf57_2$

It would be nice to be able to authorize commandhandlers.

public class TestCommandHandler {

  private EventBus eventBus;

  public Integer handle(TestCommand command) {
    TestEvent event = new TestEvent();
    return 9;



Hmm… interesting one. I agree 100% that this is a useful feature to have. And there’s probably a whole lot of other useful annotations you could put on a command handler.

The problem is related to a CGLib Proxy being proxied again.

I will look into it shortly. You can track progress here: http://code.google.com/p/axonframework/issues/detail?id=111




the same happens if you annotate a @CommandHandler and @EventHandler
on two different methods in the same class. Probably the same issue
and not as interesting as the other one.