Handler not being subscribed . . . why?

I am writing a small demonstration app using the Axon event bus
(1.1.2). It is a Spring 3 app.
For some reason my handler is not subscribing to the bus. Any ideas?
Thanks. Eric


. . .
         <axon:event-bus id="eventBus"/>

      <property name="eventBus" ref="eventBus"/>
      <property name="executor" ref="taskExecutor"/>

    <bean id="taskExecutor"
             <property name="corePoolSize" value="2"/>
             <property name="maxPoolSize" value="5"/>
             <property name="waitForTasksToCompleteOnShutdown"

. . .


public class ExampleHandler {

  public void onExampleEvent(ExampleEvent event) {

    try {
      FileWriter fw = new FileWriter("log.txt", true);
    catch (IOException e) {


event generator:

  SimpleEventBus eventBus;

. . .

  public void sendExampleEvent(String color, String shape) {
    ExampleEvent event = new ExampleEvent();
    event.setText(color + " " + shape);

Hi Eric,

Your ExampleHandler needs to be registered as a bean in Spring so that
AnnotationEventListenerBeanPostProcessor can find the annotated
methods. So following your example above you'd need this in your
context file:

<bean class="...ExampleHandler" />

On another note, since you're using the @Autowired annotation you
might be interested in looking into the other Spring 3 annotations and
component-scan to make your wiring easier -- and less/no XML
configuration files. Just refer to chapter 3.10 "Classpath scanning
and managed components" in the Spring manual.


Thanks! I will check out your suggestion.