vendredi 15 mai 2015

Get Observer pattern on EJBs working on my web app

I am trying to get the EJB Observer pattern to work and it seems very straight forward from examples like this:

http://ift.tt/Hw84i7

however when I implement the method:

public void doLogging(@Observes String message){
    System.out.println("Observed:"+message);
}

the @Observer annotation import does not get inserted.

Also if I do it manually as:

import javax.enterprise.event.Observes;

it does not work looking like I do not have the classes/jars.

I am using EJB 3.0 and am hoping this is not present only in 3.1. If this is the case how can i get the Observer pattern in EJB 3.0?

Aucun commentaire:

Enregistrer un commentaire