Caused by: java.lang.NullPointerException
at com.vaadin.cdi.internal.CDIUtil.getSessionId(CDIUtil.java:64) [vaadin-cdi-1.0.2.jar:1.0.2]
at com.vaadin.cdi.internal.CDIUtil.getSessionId(CDIUtil.java:59) [vaadin-cdi-1.0.2.jar:1.0.2]
at com.vaadin.cdi.internal.ViewBean.<init>(ViewBean.java:42) [vaadin-cdi-1.0.2.jar:1.0.2]
at com.vaadin.cdi.internal.ViewScopedContext.wrapBean(ViewScopedContext.java:57) [vaadin-cdi-1.0.2.jar:1.0.2]
at com.vaadin.cdi.internal.AbstractVaadinContext.get(AbstractVaadinContext.java:156) [vaadin-cdi-1.0.2.jar:1.0.2]
at com.vaadin.cdi.internal.ContextWrapper.get(ContextWrapper.java:49) [vaadin-cdi-1.0.2.jar:1.0.2]
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:612) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:232) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:213) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:117) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
at org.jboss.weld.event.TransactionalObserverNotifier.notifyObserver(TransactionalObserverNotifier.java:44) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:85) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:80) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:69) [weld-core-1.1.16.Final-redhat-1.jar:1.1.16.Final-redhat-1]
at qa.qmic.wavetraf.backend.quartz.DeviceStatusJob.execute(DeviceStatusJob.java:39) [wavetraf-backend-1.2.4.jar:]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.2.1.jar:]
... 1 more
Looks to me that you are trying to modify some Vaadin UI directly from quartz scheduler thread. How are you doing that? Are you wrapping the execution to UI.access method? That thread don’t have an easy way to detect the http session or the Vaadin UI.
From my Job class, I fire an event that catched by mu UI view and where I got data from the Presenter and display results on the UI. The UI update uses the UI.access method to display new data.
Looking at the stacktrace and Vaadin CDI sources, some threadlocals seems to be badly set. Any change to create a small usage example for the use case? That would help a lot our CDI maintainer to do the correct fix.
So you are trying to catch events (RefreshEvent) emitted by QuartzJob directly in you UI instances? I can ask our CDI maintainer to look into this, but I think this is just not possible. As a workaround you could create a Set of your VaadinUI’s to your QuarzJob and notify them directly from there. Maintaining that set could happen with CDI events.
is there any other better way to integrate the Quartz framework with the Vaadin CDI addon ??
I have also tried to extends an UI presenter class to a Quartz Job but again I have a CDI data session invalid.