-
1. Re: AJAX Push Error - "Service Tracker has not been initialized"
gregst Jun 17, 2012 12:17 PM (in response to gregst)There is an external thread (not the faces context thread) that is publishing a message to the topic context and this is where the exception occurs. When publishing the message in the faces context thread there is no exception.
Without the cdi services extension, the context class loader is the same for the faces context thread and the external thread. With the cdi services extension, the context class loaders are different and there is no service factory set for the external thread context class loader.
To publish with an external thread, push is initialized on startup. Is there something more to make this work with the cdi service extension?
-
2. Re: AJAX Push Error - "Service Tracker has not been initialized"
lfryc Jun 18, 2012 5:13 AM (in response to gregst)The Push should be initialized at startup in order to ensure FacesContext is available in time of initializing Push Context.
Then, when you are pushing messages, you need to ensure you are pushing using Web application's class loader, the shared classloaders won't have Push Context visible.
----
Which container are you running?
-
3. Re: AJAX Push Error - "Service Tracker has not been initialized"
gregst Jun 18, 2012 12:17 PM (in response to lfryc)Running in JBoss 7.1.1 and have the "org.richfaces.push.initializeOnStartup" enabled.
However, the problem is as you indicated where this external thread is not "pushing using Web application's class loader". After seeing this, the external thread is now using another thread created with the web application class loader and having the required push context.
This CDI service extension was added to eagerly intantiate the application scoped bean containing this external thread. Even though it was annotated with @Startup, the application bean was instantiated with the web application class loader when injected in a session bean.
After the service extension was added to eagerly instantiate the application bean, the bean is now created with the enterprise application class loader. In this case, the push does not work from this external thread because it does not have the push context.
Given the way this is working, probably will look at using JMS for pushing instead of this "push context".
Thanks for the help.