WFLYCTL0412: Required services that are not installed:

B.J. A.A. picture B.J. A.A. · Sep 1, 2016 · Viewed 61k times · Source

I'm trying to add a datasource in Wildfly 10.0, but when i test connection this the error message that throws:

Unexpected HTTP response: 500

Request
{
    "address" => [
        ("subsystem" => "datasources"),
        ("data-source" => "PostgreCrawlazo")
    ],
    "operation" => "test-connection-in-pool"
}

Response

Internal Server Error
{
    "outcome" => "failed",
    "failure-description" => "WFLYJCA0040: failed to invoke operation: WFLYJCA0042: failed to match pool. Check JndiName: java:/crawlazo",
    "rolled-back" => true,
    "response-headers" => {"process-state" => "reload-required"}
}

The error from the server log:

2016-09-01 16:28:40,524 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "PostgreCrawlazo")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => [
        "jboss.jdbc-driver.postgres",
        "jboss.jdbc-driver.postgres"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.driver-demander.java:/crawlazo is missing [jboss.jdbc-driver.postgres]",
        "org.wildfly.data-source.PostgreCrawlazo is missing [jboss.jdbc-driver.postgres]",
        "org.wildfly.data-source.PostgreCrawlazo is missing [jboss.jdbc-driver.postgres]"
    ]
}

i'm replicating the same configuration files from standalone.xml and module.xml

here is part how i set up the datasource in standalone.xml:

 <datasource jndi-name="java:/crawlazo" pool-name="PostgreCrawlazo" enabled="true">
                    <connection-url>jdbc:postgresql://x.x.x.x:5432/crawlazo</connection-url>
                    <driver>postgres</driver>
                    <pool>
                        <min-pool-size>1</min-pool-size>
                        <max-pool-size>40</max-pool-size>
                    </pool>
                    <security>
                        <user-name>someUser</user-name>
                        <password>somePasswd</password>
                    </security>
                </datasource>
                <drivers>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                    <driver name="postgres" module="org.postgres">
                        <driver-class>org.postgresql.Driver</driver-class>
                    </driver>
            </drivers>

and the module.xml:

<module xmlns="urn:jboss:module:1.0" name="org.postgresql">
    <resources>
        <resource-root path="postgresql-9.2-1004.jdbc3.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    </dependencies>
</module>

I have a postgresql-9.2-1004.jdbc3.jar in the deployment folder.

Why this error appears? what i could have forgotten to config?

Answer

ehsavoie picture ehsavoie · Sep 2, 2016

The driver jar should be in the module folder not in the deployment folder as you are implying this when you wrote :

<resources>
    <resource-root path="postgresql-9.2-1004.jdbc3.jar"/>
</resources>