How to configure jndi reference name WorkManger And Timer using http://commonj.myfoo.de/ in Jboss 7.1 When deploying war web application

Posted on

This is the configuration i have which is working fine in tomcat ,
Using : http://commonj.myfoo.de/
Now when i try to install the war web app in JBoss 7.1 as standalone application (not domain)
I keep getting those errors:

In WEB-INF/web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <resource-ref>
        <description>DB connection</description>
        <res-ref-name>jdbc/DEMODB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>    
    <resource-ref>
        <res-ref-name>xx/DemoClientManger</res-ref-name>
        <res-type>my.worker.handler</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
</web-app>

In Jboss-web.xml

<jboss-web>
   <resource-ref>
        <res-ref-name>jdbc/DEMODB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <jndi-name>java:/comp/env/jdbc/DEMODB</jndi-name>
    </resource-ref>

    <resource-ref>
        <res-ref-name>xx/DemoClientManger</res-ref-name>
        <res-type>my.worker.handler</res-type>
        <jndi-name>java:/xx/DemoClientManger</jndi-name>
    </resource-ref>
</jboss-web>

In METAINF/context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context>


<Resource name="jdbc/DEMODB" auth="Container" type="javax.sql.DataSource"
        username="TEST_USER"
        password="TEST_USER" driverClassName="oracle.jdbc.OracleDriver"
        url="jdbc:oracle:thin:TEST_USER/TEST_USER@xxx.xx.11.22:3333/orcl"
        validationQuery="SELECT 1 from dual"
        testOnBorrow="true"
        />

<Resource name="xx/DemoClientManger" auth="Container"
        type="my.worker.handler" factory="de.myfoo.commonj.work.FooWorkManagerFactory"
        minThreads="99" maxThreads="100" />

<WatchedResource>WEB-INF/web.xml</WatchedResource>

</Context>

Im getting when deploying the web app as war file:

18:30:23,780 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 7) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "myapp.war")]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => [
        "jboss.naming.context.java.comp.env.jdbc.DEMODB",
        "jboss.naming.context.java.DemoClientManger"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [       
        "jboss.naming.context.java.module.myapp.myapp.env.jdbc.DEMODB is missing [jboss.naming.context.java.comp.env.jdbc.DEMODB]",
        "jboss.naming.context.java.module.myapp.myapp.env.xx.DemoClientManger is missing [jboss.naming.context.java.DemoClientManger]"

    ]
}
18:30:23,793 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0019: Stopped Driver service with driver-name = myapp.war_com.microsoft.sqlserver.jdbc.SQLServerDriver_4_0
18:30:23,805 ERROR [org.jboss.as.server] (External Management Request Threads -- 7) WFLYSRV0021: Deploy of deployment "myapp.war" was rolled back with the following failure message:
{
    "WFLYCTL0412: Required services that are not installed:" => [
        "jboss.naming.context.java.comp.env.jdbc.DEMODB",
        "jboss.naming.context.java.DemoClientManger"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.naming.context.java.module.myapp.myapp.env.jdbc.DEMODB is missing [jboss.naming.context.java.comp.env.jdbc.DEMODB]",
        "jboss.naming.context.java.module.myapp.myapp.env.xx.DemoClientManger is missing [jboss.naming.context.java.DemoClientManger]"
    ]
}

What im missing here ?
How to get more info on where to configure the WorkManager And naming reference which using external class ?