How to configure JBossWorkManager in JBoss 5.1
raviraghava Sep 21, 2009 11:26 AMHi,
I am migrating the application from WebSphere 6.1 to JBoss 5.1. In WebSphere, pieces of code were using default workmanager and asyncbean package. Can you please tell me the right configuration that I need to use in web.xml or applicationContext.xml for using JBossWorkManager. Also, please suggest if I had to make any code changes (I replaced async bean package for WebSphere with JBossWorkManager package). Furnished is the configuration that I have right now but it is throwing Exception. Your help is much appreciated.
Code in applicationContext.xml:
1. 2. <bean id="taskExecutor" class="org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor"> 3. <property name="workManagerName" value="WorkManager"/> 4. <property name="resourceRef" value="true"/> 5. </bean>
Code in web.xml:
1. 2. <resource-ref id="ResourceRef_1163654014164"> 3. <description>WorkManager</description> 4. <res-ref-name>WorkManager</res-ref-name> 5. <res-type>org.jboss.resource.work.JBossWorkManager</res-type> 6. <res-auth>Container</res-auth> 7. <res-sharing-scope>Shareable</res-sharing-scope> 8. </resource-ref>
Exception when the application is deployed:
009-09-18 13:25:58,382 SEVERE [org.springframework.web.context.ContextLoader] (HDScanner) Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskExecutor' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: WorkManager not bound
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
.
.
.
Caused by: javax.naming.NameNotFoundException: WorkManager not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
Thanks a lot. Your earliest response would be of very great help.
Ravi