7 Replies Latest reply on Aug 26, 2015 5:53 AM by Manzar Chaudhary

    JBoss WorkManager configuration

    chaatna Newbie

      Hi,

       

      I have now work manager configuration as follows:

      <bean id="taskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">

      <property name="workManagerName" value="wm/default" />

      </bean>

       

      But the above one is intended for WebSphere. So I have changed it to as follows:

       

      web.xml
      -----------
      <resource-ref id="ResourceRef_1163654014164">  
           <description>WorkManager</description>  
           <res-ref-name>WorkManager</res-ref-name>  
           <res-type>org.jboss.resource.work.JBossWorkManager</res-type>  
           <res-auth>Container</res-auth>  
           <res-sharing-scope>Shareable</res-sharing-scope>  
         </resource-ref>

       

      jboss.web.xml
      -----------------
      <resource-ref id="ResourceRef_1163654014164">  
            <description>WorkManager</description>  
            <res-ref-name>jboss.jca:service=WorkManager</res-ref-name>  
            <res-type>org.jboss.resource.work.JBossWorkManager</res-type>  
            <res-auth>Container</res-auth>  
            <res-sharing-scope>Shareable</res-sharing-scope>  
            <jndi-name>WorkManager</jndi-name>  

       

      </resource-ref>


      spring-messaging.xml
      -------------------
      <bean id="taskExecutor" class="org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor">    
              <property name="workManagerName" value="WorkManager"/>  
              <property name="resourceRef" value="true"/>  
          </bean> 

      Now I am getting an error as follows:

      19:04:11,607 INFO [TomcatDeployment] deploy, ctxPath=/test-app-web

      19:04:11,638 ERROR [StandardContext] Context [/test-app-web] startup failed due to previous errors

       

       

      java.lang.RuntimeException

       

       

      : mapped-name is required for WorkManager of deployment test-app-web.war

      at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceRefs(

      WebResourceHandler.java:178

      )

      at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(

      WebResourceHandler.java:327

      )

      at org.jboss.web.tomcat.service.TomcatInjectionContainer.processMetadata(

      TomcatInjectionContainer.java:537

      )

      at org.jboss.web.tomcat.service.WebCtxLoader.start(

      WebCtxLoader.java:158

      )

      at org.apache.catalina.core.StandardContext.start(

      StandardContext.java:4272

      )

      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(

      TomcatDeployment.java:321

      )

      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(

      TomcatDeployment.java:145

      )

      at org.jboss.web.deployers.AbstractWarDeployment.start(

      AbstractWarDeployment.java:461

      )

      at org.jboss.web.deployers.WebModule.startModule(

      WebModule.java:118

      )

      at org.jboss.web.deployers.WebModule.start(

      WebModule.java:97

      )

      at sun.reflect.NativeMethodAccessorImpl.invoke0(

      Native Method

      )

      at sun.reflect.NativeMethodAccessorImpl.invoke(

      NativeMethodAccessorImpl.java:39

      )

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(

      DelegatingMethodAccessorImpl.java:25

      )

      at java.lang.reflect.Method.invoke(

      Method.java:597

      )

      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(

      ReflectedDispatcher.java:157

      )

      at org.jboss.mx.server.Invocation.dispatch(

      Invocation.java:96

      )

      at org.jboss.mx.server.Invocation.invoke(

      Invocation.java:88

      )

      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(

      AbstractMBeanInvoker.java:264

      )

      at org.jboss.mx.server.MBeanServerImpl.invoke(

      MBeanServerImpl.java:668

      )

      at org.jboss.system.microcontainer.ServiceProxy.invoke(

      ServiceProxy.java:206

      )

      at $Proxy38.start(Unknown Source)

      at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(

      StartStopLifecycleAction.java:42

      )

      at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(

      StartStopLifecycleAction.java:37

      )

      at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(

      SimpleControllerContextAction.java:62

      )

      at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(

      AccessControllerContextAction.java:71

      )

      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(

      AbstractControllerContextActions.java:51

      )

      at org.jboss.dependency.plugins.AbstractControllerContext.install(

      AbstractControllerContext.java:348

      )

      at org.jboss.system.microcontainer.ServiceControllerContext.install(

      ServiceControllerContext.java:297

      )

      at org.jboss.dependency.plugins.AbstractController.install(

      AbstractController.java:1652

      )

      at org.jboss.dependency.plugins.AbstractController.incrementState(

      AbstractController.java:938

      )

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(

      AbstractController.java:1082

      )

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(

      AbstractController.java:988

      )

      at org.jboss.dependency.plugins.AbstractController.change(

      AbstractController.java:826

      )

      at org.jboss.dependency.plugins.AbstractController.change(

      AbstractController.java:556

      )

      at org.jboss.system.ServiceController.doChange(

      ServiceController.java:688

      )

      at org.jboss.system.ServiceController.start(

      ServiceController.java:460

      )

      at org.jboss.system.deployers.ServiceDeployer.start(

      ServiceDeployer.java:163

      )

      at org.jboss.system.deployers.ServiceDeployer.deploy(

      ServiceDeployer.java:99

      )

      at org.jboss.system.deployers.ServiceDeployer.deploy(

      ServiceDeployer.java:46

      )

      at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(

      AbstractSimpleRealDeployer.java:62

      )

      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(

      AbstractRealDeployer.java:55

      )

      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(

      DeployerWrapper.java:179

      )

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(

      DeployersImpl.java:1454

      )

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(

      DeployersImpl.java:1172

      )

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(

      DeployersImpl.java:1193

      )

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(

      DeployersImpl.java:1225

      )

      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(

      DeployersImpl.java:1113

      )

      at org.jboss.dependency.plugins.AbstractControllerContext.install(

      AbstractControllerContext.java:348

      )

      at org.jboss.dependency.plugins.AbstractController.install(

      AbstractController.java:1652

      )

      at org.jboss.dependency.plugins.AbstractController.incrementState(

      AbstractController.java:938

      )

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(

      AbstractController.java:1082

      )

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(

      AbstractController.java:988

      )

      at org.jboss.dependency.plugins.AbstractController.change(

      AbstractController.java:826

      )

      at org.jboss.dependency.plugins.AbstractController.change(

      AbstractController.java:556

      )

      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(

      DeployersImpl.java:789

      )

      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(

      MainDeployerImpl.java:699

      )

      at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(

      MainDeployerAdapter.java:117

      )

      at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(

      ProfileDeployAction.java:70

      )

      at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(

      AbstractProfileAction.java:53

      )

      at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(

      AbstractProfileService.java:403

      )

      at org.jboss.dependency.plugins.AbstractControllerContext.install(

      AbstractControllerContext.java:348

      )

      at org.jboss.dependency.plugins.AbstractController.install(

      AbstractController.java:1652

      )

      at org.jboss.dependency.plugins.AbstractController.incrementState(

      AbstractController.java:938

      )

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(

      AbstractController.java:1082

      )

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(

      AbstractController.java:988

      )

      at org.jboss.dependency.plugins.AbstractController.install(

      AbstractController.java:778

      )

      at org.jboss.dependency.plugins.AbstractController.install(

      AbstractController.java:543

      )

      at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(

      AbstractProfileService.java:308

      )

      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(

      ProfileServiceBootstrap.java:256

      )

      at org.jboss.bootstrap.AbstractServerImpl.start(

      AbstractS

      erverImpl.java:461

      )

      at org.jboss.Main.boot(

      Main.java:221

      )

      at org.jboss.Main$1.run(

      Main.java:556

      )

      at java.lang.Thread.run(

      Thread.java:619

      )

      Please suggest me how to resolve the above issue?

      Thanks,

      Chaatna

        • 1. Re: JBoss WorkManager configuration
          chaatna Newbie

          I am answering my question myself. I justremoved the configuration from web.xml and jboss.xml.

           

          That's all. It resolved that issue due to having the MBEAN for WorkManager inside deploy folder "jca-jboss-beans.xml" file (JBoss installation directory).

           

          Thanks

          • 2. Re: JBoss WorkManager configuration
            chaatna Newbie

            Hi,

             

            Again I am getting one more exception for the same. The configuration is as follows:

             

            web.xml

            -------------

             

            <resource-ref id="ResourceRef_1163654014164">

             

            <description>WorkManager</description>

             

            <res-ref-name>WorkManager</res-ref-name>

             

            <res-type>org.jboss.resource.work.JBossWorkManager</res-type>

             

            <res-auth>Container</res-auth>

             

            <res-sharing-scope>Shareable</res-sharing-scope>

             

            </resource-ref>

             

             

             

            jboss-web.xml

            ----------------------

               

            <resource-ref id="ResourceRef_1163654014164">

             

            <description>WorkManager</description>

             

            <res-ref-name>WorkManager</res-ref-name>

             

            <jndi-name>WorkManager</jndi-name>

             

            <ignore-dependency/>

             

            </resource-ref>

             

            applicationContext.xml

            ---------------------------------------

            <bean id="taskExecutor" class="org.springframework.jca.work.jboss.JBossWorkManagerTaskExecutor">   
            </bean>

            Exception Log:

            -----------------------------

            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

             

             

            Please help regarding this where we are struggling.

             

            Thanks

             

            Message was edited by: chaatna

            • 3. Re: JBoss WorkManager configuration
              chaatna Newbie

              Don't we have anybody to help me

              • 4. Re: JBoss WorkManager configuration
                chaatna Newbie

                I am answering my question myself which may be helpful for somebody.

                Removed configuration in web.xml and jboss.web.xml for this JBoss Work Manager.

                Have the following configuration in applicationContext.xml

                <

                 

                bean id="jbossResourceAdapter" class="org.jboss.resource.adapter.jms.JmsResourceAdapter"/>

                 

                 

                <bean id="mbeanServer" class="org.jboss.mx.util.MBeanServerLocator" factory-method="locateJBoss"/>

                 

                 

                <bean id="chanduWorkManager" factory-bean="mbeanServer" factory-method="getAttribute">

                 

                <constructor-arg>

                 

                <bean class="org.springframework.jmx.support.ObjectNameManager" factory-method="getInstance">

                 

                <constructor-arg value="jboss.jca:service=ChanduWorkManager" />

                 

                </bean>

                 

                </constructor-arg>

                 

                <constructor-arg value="Instance" />

                 

                </bean>

                 

                 

                <bean id="taskExecutor" class="org.springframework.jca.work.WorkManagerTaskExecutor">

                 

                <property name="workManager" ref="chanduWorkManager"/>

                 

                </bean>

                 

                 

                <bean id="jbossResourceAdapterFactory" class="org.springframework.jca.support.ResourceAdapterFactoryBean">

                 

                <property name="resourceAdapter" ref="jbossResourceAdapter"/>

                 

                <property name="workManager" ref="taskExecutor"/>

                 

                </bean>

                 

                 

                <bean id="jbossActivationSpecFactory" class="org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory">

                 

                <property name="activationSpecClass" value="org.jboss.resource.adapter.jms.inflow.JmsActivationSpec"/>

                 

                <property name="defaultProperties">

                 

                <props>

                 

                <prop key="sessionTransacted">false</prop>

                 

                <prop key="minSession">1</prop>

                 

                <prop key="maxSession">15</prop>

                 

                </props>

                 

                </property>

                 

                </bean>

                 

                Hope it will help somebody.

                Thanks, Chaandrasekhar Aadhanapattu

                • 5. Re: JBoss WorkManager configuration
                  Amin Mohammed Newbie

                  i am facing same issue for JboSS AS7 ..

                   

                  you mentioned u removed entry form web and jboss-web.xml . when app tries to load WorkManager what pool you used ?

                   

                  can you paste the contents of jca-jboss-beans.xml

                   


                  • 6. Re: JBoss WorkManager configuration
                    Marc Gagnon Newbie

                    Using a workmanager was never intended to be used in general applications.

                    There are other mecanisms for achieving parallelisim.

                    Please read this: https://community.jboss.org/message/718053

                    And https://community.jboss.org/message/794662

                    • 7. Re: JBoss WorkManager configuration
                      Manzar Chaudhary Newbie

                      can you please tell that what changes are required in jca-jboss-bean.xml?