4

This is the configuration i have which is working fine in tomcat ,
Im using http://commonj.myfoo.de/ as the workmanger and timer 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 is the mistake ?
UPDATE Im using http://commonj.myfoo.de/ as the workmanger and timer , i read there is problem with this :
https://access.redhat.com/solutions/199183 is this related ?

user63898
  • 29,839
  • 85
  • 272
  • 514

1 Answers1

2

Please show your database config in a standalone.xml file, there you should place JNDI name:

<datasource jta="true" jndi-name="java:/comp/env/jdbc/DEMODB"

I am not sure if you need comp/env prefix in JNDI, in JBOSS EAP 7.1 you can simply use jndi-name="java:/jdbc/DEMODB"

  • well the datasource i can see in the standalone.xml but what about the :Resource name="xx/DemoClientManger" whihc is not database configuration ? – user63898 Apr 11 '19 at 20:32
  • 1
    I don't have experiance with that, but tou need to add your custom WorkManager under in standalone.xml. Like here https://access.redhat.com/solutions/3626201. Also add jndi name : – Олег Гаврилів Apr 12 '19 at 08:29
  • ok this something .. what about class .. type .. key/value parameters that go with the tomcat configuration ? – user63898 Apr 12 '19 at 11:28