java ee - CDI event is always null -
cdi event null below exception. wondering whether can use cdi in general static methods. class should managed bean, in order make cdi event work?
public class util { @inject @yellow static event<documentmessageevent> documentevent; public static list<atp> convertiball(string filename) throws resourceexception { ..... fireevent(page) } private synchronized static void fireevent(apvo page){ try { documentevent.fire(new documentmessageevent(page)); } catch (exception e) { log.error( "exception caught while firing documentmessageevent [" + page.getpagenumber() + "] - " + e.getmessage(), e); } } }
error
exception caught while firing documentmessageevent [2] - null: java.lang.nullpointerexception
Comments
Post a Comment