wildfly maven plugin fail to deploy mysql datasource
vdtoorn Mar 30, 2015 11:34 AMDear all,
I'm trying to set up an EAR project from Netbeans, using the wildfly-maven-plugin (1.0.2-Final) in a maven project.
I'm able to upload the mysql connector as a jdbc driver, and I can create a datasource manually based on it. Unfortunately, when I try to deploy a datasource, it does not work failing with a message about the driver not found.
My configuration looks like this:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>
<configuration>
<jboss-home>${wildfly-home}</jboss-home>
</configuration>
<executions>
<execution>
<id>deploy_jdbc_driver</id>
<phase>package</phase>
<goals>
<goal>deploy-artifact</goal>
</goals>
<configuration>
<groupId>${mysql.driver.groupId}</groupId>
<artifactId>${mysql.driver.artifactId}</artifactId>
<version>${mysql.driver.version}</version>
<name>${mysql.driver.name}</name>
<driver-name>${mysql.driver.name}</driver-name>
</configuration>
</execution>
<execution>
<id>add_datasource</id>
<phase>package</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<address>subsystem=datasources,data-source=java:jboss/datasources/qcdb</address>
<resources>
<resource>
<properties>
<jndi-name>java:jboss/datasources/qcdb</jndi-name>
<connection-url>${db.jdbc.url}</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver-name>${mysql.driver.name}</driver-name>
<enabled>true</enabled>
<database-name>${mysql.db.schema}</database-name>
<security.user-name>${mysql.db.user}</security.user-name>
<security.password>${mysql.db.password}</security.password>
<pool-name>qcdb_pool</pool-name>
</properties>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
With the relevant properties above:
<properties>
<mysql.server>localhost</mysql.server>
<mysql.port>3306</mysql.port>
<mysql.driver.groupId>mysql</mysql.driver.groupId>
<mysql.driver.artifactId>mysql-connector-java</mysql.driver.artifactId>
<mysql.driver.version>5.1.34</mysql.driver.version>
<mysql.db.schema>qcdb</mysql.db.schema>
<mysql.db.user>qcdb</mysql.db.user>
<mysql.db.password>qcdb</mysql.db.password>
<db.jdbc.url>jdbc:mysql://${mysql.server}:${mysql.port}/qcdb</db.jdbc.url>
<mysql.driver.name>${mysql.driver.artifactId}-${mysql.driver.version}</mysql.driver.name>
<wildfly-home>c:/wildfly-8.2.0.Final/</wildfly-home>
<wildfly.hibernate.datasource.name>java:/jboss/datasources/qcdb</wildfly.hibernate.datasource.name>
</properties>
Moreover I have a dependency on the mysql connector like so:
<dependency>
<groupId>${mysql.driver.groupId}</groupId>
<artifactId>${mysql.driver.artifactId}</artifactId>
<version>${mysql.driver.version}</version>
<scope>provided</scope>
</dependency>
Unfortunately, the error I get is this:
Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:add-resource (add_datasource) on project qcCollector: Could not execute goal add-resource. Reason: Operation failed: {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:jboss/datasources/qcdb is missing [jboss.jdbc-driver.mysql-connector-java-5_1_34]",
"jboss.driver-demander.java:jboss/datasources/qcdb is missing [jboss.jdbc-driver.mysql-connector-java-5_1_34]"
]}}}
Can anybody please help me to get this resolved? It's driving me nuts, especially because I think it worked once..
Regards, Henk