title: Could not initialize JBossWorkManagerTaskExecutor because JBoss API is not available: java.lang.reflect.InvocationTargetException
body: <p>I have a requirement to configure JBoss WorkManager in my application. Earlier the configuration was as follows:</p>
  
  <pre><code>&lt;bean id="taskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor"&gt;
      &lt;property name="workManagerName" value="wm/default" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The clas "WorkManagerTaskExecutor" is intended for WebSphere and WebLogc. But we are migrating our application from WebSphere to JBOss. So I have the following configuration.</p>
  
  <h2><strong>web.xml</strong></h2>
  
  <pre><code>&lt;resource-ref id="ResourceRef_1163654014164"&gt;
  &lt;description&gt;WorkManager&lt;/description&gt;
  &lt;res-ref-name&gt;WorkManager&lt;/res-ref-name&gt;
  &lt;res-type&gt;org.jboss.resource.work.JBossWorkManager&lt;/res-type&gt;
  &lt;res-auth&gt;Container&lt;/res-auth&gt;
  &lt;res-sharing-scope&gt;Shareable&lt;/res-sharing-scope&gt;
  &lt;/resource-ref&gt; 
  </code></pre>
  
  <h2><strong>jboss-web.xml</strong></h2>
  
  <pre><code>&lt;resource-ref id="ResourceRef_1163654014164"&gt;
  &lt;description&gt;WorkManager&lt;/description&gt;
  &lt;res-ref-name&gt;WorkManager&lt;/res-ref-name&gt; 
  &lt;jndi-name&gt;WorkManager&lt;/jndi-name&gt;
  &lt;ignore-dependency/&gt;
  &lt;/resource-ref&gt;
  </code></pre>
  
  <h2><strong>applicationContext.xml</strong></h2>
  
  <pre><code>&lt;bean id="taskExecutor"     class="org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor"&gt;     
  &lt;/bean&gt;
  </code></pre>
  
  <h2><strong>Exception Log:</strong></h2>
  
  <pre><code>17:04:39,472 ERROR [LogInterceptor] 
  
  EJBException in method: public abstract com.test.ejb.timer.SLATimer com.test.ejb.timer.SLATimerHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException, causedBy:
  org.springframework.beans.factory.BeanCreationException
  
  : Error creating bean with name 'taskExecutor' defined in class path resource [spring-messaging.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not initialize JBossWorkManagerTaskExecutor because JBoss API is not available: 
  
  java.lang.reflect.InvocationTargetException
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean    (AbstractAutowireCapableBeanFactory.java:1420)
  
  Caused by: java.lang.IllegalStateException: Could not initialize JBossWorkManagerTaskExecutor because JBoss API is not available: 
  
  java.lang.reflect.InvocationTargetException
  </code></pre>
  
  <p>Please help to fix the above issue.</p>
  
  <p>Thanks</p>