2 Replies Latest reply: May 25, 2012 9:22 AM by Fernando Fabreti RSS

Jboss 7.1.1 FAILED MySql datasource test-connection-in-pool

Fernando Fabreti Newbie

I have installed MySql JDBC Driver following directions at https://community.jboss.org/wiki/DataSourceConfigurationInAS7

 

When I try to test it, this happens:

[standalone@localhost:9999 /] /subsystem=datasources/data-source=java\:jboss\/datasources\/MySqlDS:test-connection-in-pool

{

    "outcome" => "failed",

    "failure-description" => "JBAS014807: Management resource '[

    (\"subsystem\" => \"datasources\"),

    (\"data-source\" => \"java:jboss/datasources/MySqlDS\")

]' not found",

    "rolled-back" => true

}

 

I'm completely stuck on this, I've double-checked, I've searched the forum and goggled.

 

 

My configs are:

 

 

/usr/local/jboss# ls -la modules/com/mysql/main

drwxr-xr-x 2 jboss jboss   4096 2012-04-12 13:06 ./

drwxr-xr-x 3 jboss jboss   4096 2012-04-12 10:49 ../

-rw-r--r-- 1 jboss jboss    263 2012-04-12 10:53 module.xml

-rw-r--r-- 1 jboss jboss 801912 2012-04-12 09:54 mysql-connector-java-5.1.19-bin.jar

-rw-r--r-- 1 jboss jboss    461 2012-04-12 11:03 mysql-connector-java-5.1.19-bin.jar.index

/usr/local/jboss# cat modules/com/mysql/main/module.xml

<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="urn:jboss:module:1.0" name="com.mysql">

  <resources>

    <resource-root path="mysql-connector-java-5.1.19-bin.jar"/>

  </resources>

  <dependencies>

    <module name="javax.api"/>

  </dependencies>

</module>

/usr/local/jboss# cat standalone/configuration/standalone.xml

[..]

<subsystem xmlns="urn:jboss:domain:datasources:1.0">

            <datasources>

                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>

                    <driver>h2</driver>

                    <security>

                        <user-name>sa</user-name>

                        <password>sa</password>

                    </security>

                </datasource>

        <datasource jndi-name="java:/MySqlDS" enabled="true" use-java-context="true" pool-name="MySqlDS">

                <connection-url>jdbc:mysql://localhost:3306/sfitx_development</connection-url>

                    <driver>com.mysql</driver>

                <driver-class>

                    com.mysql.jdbc.Driver

                </driver-class>

                    <pool>

            <min-pool-size>10</min-pool-size>

                <max-pool-size>100</max-pool-size>

                <prefill>true</prefill>

            </pool>

                    <security>

                        <user-name>jruby</user-name>

                        <password>123456</password>

                    </security>

                    <validation></validation>

                    <timeout></timeout>

                    <statement>

                <prepared-statement-cache-size>32</prepared-statement-cache-size>

                <share-prepared-statements/>

            </statement>

                </datasource>

                <drivers>

                    <driver name="h2" module="com.h2database.h2">

                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                    </driver>

                    <driver name="com.mysql" module="com.mysql">

            <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>

                <!--driver-class>com.mysql.jdbc.Driver</driver-class-->

            </driver>

                </drivers>

            </datasources>

        </subsystem>

 

 

/usr/local/jboss# bin/standalone.sh

=========================================================================

  JBoss Bootstrap Environment

JBOSS_HOME: /usr/local/jboss

JAVA: java

 

  JAVA_OPTS:  -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml

=========================================================================

13:08:51,951 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA

13:08:52,096 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA

13:08:52,135 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting

13:08:52,854 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)

13:08:52,855 INFO  [org.xnio] XNIO Version 3.0.3.GA

13:08:52,871 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA

13:08:52,883 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA

13:08:52,912 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers

13:08:52,921 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem

13:08:52,950 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.

13:08:53,021 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem

13:08:53,023 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem

13:08:53,029 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem

13:08:53,032 INFO  [org.jboss.as.security] (MSC service thread 1-4) JBAS013100: Current PicketBox version=4.0.7.Final

13:08:53,066 INFO  [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service

13:08:53,077 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension

13:08:53,084 INFO  [org.jboss.as.connector] (MSC service thread 1-8) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)

13:08:53,085 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]

13:08:53,137 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

13:08:53,173 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

13:08:53,275 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-5) Starting Coyote HTTP/1.1 on http--0.0.0.0-8080

13:08:53,279 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-8) JBoss Web Services - Stack CXF Server 4.0.2.GA

13:08:53,540 INFO  [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100: Listening on /127.0.0.1:9999

13:08:53,540 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /0.0.0.0:4447

13:08:53,541 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-6) JBAS015012: Started FileSystemDeploymentService for directory /usr/local/jboss/standalone/deployments

13:08:53,643 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

13:08:53,652 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) JBAS010400: Bound data source [java:/MySqlDS]

13:08:53,690 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990

13:08:53,691 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 1925ms - Started 137 of 213 services (74 services are passive or on-demand)

 

http://localhost:9990/console/App.html#ds-metrics

Captura de tela em 2012-04-12 13:18:34.png

if image above does not show up:

 

Datasource

ExampleDS

java:jboss/datasources/ExampleDS

true

MySqlDS

java:/MySqlDS

true

 

 

 

MySql Instance on same machine:

 

mysql> use mysql;

Database changed

mysql> select host, db, user, select_priv from db;

+------+-------------------+-------+-------------+

| host | db                | user  | select_priv |

+------+-------------------+-------+-------------+

| %    | sfitx             | jruby | Y           |

| %    | sfitx_development | jruby | Y           |

+------+-------------------+-------+-------------+

2 rows in set (0.00 sec)

 

mysql> select host  from user where user='jruby';

+-----------+

| host      |

+-----------+

| localhost |

+-----------+

1 row in set (0.00 sec)