Cannot configure datasource in JBoss AS 7
panipsilos Oct 23, 2012 7:05 AMHi guys
I ve trying for quite some time to configure a datasource in my application , nothing works. I get various errors , and the latest is the following:
New missing/unsatisfied dependencies:
service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.data-source.jboss/datasources/MysqlDS]
13:44:34,806 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.data-source.jboss/datasources/MysqlDSjboss.jdbc-driver.mysqlMissing[jboss.data-source.jboss/datasources/MysqlDSjboss.jdbc-driver.mysql]"]}
I ve read the related thread but nothing really helped me. I guess I something is wrong with my configuration. Below you can the persistence.xml , the -ds.xml and the standalone.xml file. Could someone have a look and tell me if there is a problem with these files? .Thank you
################## Persistence.xml #################
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="ResearchManagement.Data">
<jta-data-source>java:jboss/datasources/MysqlDS</jta-data-source>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
</persistence>
################## -ds.xml #################
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is an unmanaged datasource. It should be used for proofs of concept
or testing only. It uses H2, an in memory database that ships with JBoss
AS. -->
<datasources xmlns="http://www.jboss.org/ironjacamar/schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd">
<!-- The datasource is bound into JNDI at this location. We reference
this in META-INF/persistence.xml -->
<datasource jndi-name="java:jboss/datasources/MysqlDS"
pool-name="MysqlDS" enabled="true"
use-java-context="true">
<connection-url>jdbc:mysql://127.5.54.1:3306/researchprojects</connection-url>
<driver>mysql</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
</datasource>
</datasources>
################## standalone.xml #################
<datasources> | ||
<datasource jndi-name="java:jboss/datasources/ExampleDS" enabled="true" use-java-context="true" pool-name="H2DS"> | ||
<connection-url>jdbc:h2:${jboss.server.data.dir}/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:jboss/datasources/MysqlDS" enabled="${mysql.enabled}" use-java-context="true" pool-name="MysqlDS"> | ||
<connection-url>jdbc:mysql://${env.OPENSHIFT_DB_HOST}:${env.OPENSHIFT_DB_PORT}/${env.OPENSHIFT_APP_NAME}</connection-url> | ||
<driver>mysql</driver> | ||
<security> | ||
<user-name>${env.OPENSHIFT_DB_USERNAME}</user-name> | ||
<password>${env.OPENSHIFT_DB_PASSWORD}</password> | ||
</security> | ||
<validation> | ||
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql> | ||
</validation> | ||
</datasource> | ||
<datasource jndi-name="java:jboss/datasources/PostgreSQLDS" enabled="${postgresql.enabled}" use-java-context="true" pool-name="PostgreSQLDS" use-ccm="true"> | ||
<connection-url>jdbc:postgresql://${env.OPENSHIFT_DB_HOST}:${env.OPENSHIFT_DB_PORT}/${env.OPENSHIFT_APP_NAME}</connection-url> | ||
<driver>postgresql</driver> | ||
<security> | ||
<user-name>${env.OPENSHIFT_DB_USERNAME}</user-name> | ||
<password>${env.OPENSHIFT_DB_PASSWORD}</password> | ||
</security> | ||
<validation> | ||
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql> | ||
</validation> | ||
</datasource> | ||
<drivers> | ||
<driver name="h2" module="com.h2database.h2"> | ||
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class> | ||
</driver> | ||
<driver name="mysql" module="com.mysql.jdbc"> | ||
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class> | ||
</driver> | ||
<driver name="postgresql" module="org.postgresql.jdbc"> | ||
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class> | ||
</driver> | ||
</drivers> | ||
</datasources> |