5 Replies Latest reply on Nov 1, 2012 8:48 AM by psilos panipsilos

    [ERROR] New missing/unsatisfied dependencies: (Cannot configure datasource)

    psilos panipsilos Newbie

      Hi guys I have a web app using JSF(Primefaces), JPA(Hibernate) and EJBs and have troubles to vonfigure the datasource. I m getting the follwoing error:

       

      2012/10/31 07:20:17,948 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

      2012/10/31 07:20:18,836 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "ROOT.war" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"ROOT.war#test\"jboss.naming.context.java.jboss.datasources.MysqlDSMissing[jboss.persistenceunit.\"ROOT.war#test\"jboss.naming.context.java.jboss.datasources.MysqlDS]"]}

      2012/10/31 07:20:19,252 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment ROOT.war in 413ms

      2012/10/31 07:20:19,255 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.naming.context.java.jboss.datasources.MysqlDS (missing) dependents: [service jboss.persistenceunit."ROOT.war#test"]

       

      2012/10/31 07:20:19,334 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.persistenceunit.\"ROOT.war#test\"jboss.naming.context.java.jboss.datasources.MysqlDSMissing[jboss.persistenceunit.\"ROOT.war#test\"jboss.naming.context.java.jboss.datasources.MysqlDS]"]}}}

       

      Below you can see the persistence.xml file. , the stanadlone.xml file , the pom.xml file . Could be that I m missing some dependency in the pom.xml???

       

      Persistence.xml

      <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
        <persistence-unit name="test"  >
             <provider>org.hibernate.ejb.HibernatePersistence</provider>  
          <jta-data-source>java:jboss/datasources/MysqlDS</jta-data-source>  
          <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>     
            <property name="hibernate.show_sql" value="true"/> 
            <property name="hibernate.max_fetch_depth" value="3"/>
            <property name="hibernate.hbm2ddl.auto" value="update" />
          </properties>
        </persistence-unit>
      </persistence>
      

       

      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://127.5.54.1:3306/researchprojects</connection-url>
                          <driver>mysql</driver>
                          <security>
                            <user-name>admin</user-name>
                            <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>
      

       

      Pom.xml

       

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>projectmanagementapplication</groupId>
        <artifactId>projectmanagementapplication</artifactId>
        <packaging>war</packaging>
        <version>1.0</version>
        <name>projectmanagementapplication</name>
        <properties>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          <maven.compiler.source>1.6</maven.compiler.source>
          <maven.compiler.target>1.6</maven.compiler.target>
        </properties>
      
        <repositories>
        <repository>  
             <id>prime-repo</id>  
            <name>PrimeFaces Maven Repository</name>  
           <url>http://repository.primefaces.org</url>  
            <layout>default</layout>  
       </repository>
         </repositories>
      
      
        <dependencies>
          <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-6.0</artifactId>
            <version>1.0.0.Final</version>
            <type>pom</type>
            <scope>provided</scope>
          </dependency>       
          <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.0-api</artifactId>
            <version>1.0.1.Final</version>
          </dependency>
          <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.1.0.Final</version>
          </dependency>
          <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.1.0.Final</version>
          </dependency>
          <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.18</version>
          </dependency>
          <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
          </dependency>
            <dependency>  
             <groupId>org.primefaces</groupId>  
              <artifactId>primefaces</artifactId>  
            <version>3.4.1</version>  
       </dependency>
        </dependencies>
      
        <profiles>
          <profile>
           <!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. -->
           <!-- Use this profile for any OpenShift specific customization your app will need. -->
           <!-- By default that is to put the resulting archive into the 'deployments' folder. -->
           <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
           <id>openshift</id>
           <build>
              <finalName>projectmanagementapplication</finalName>
              <plugins>
                <plugin>
                  <artifactId>maven-war-plugin</artifactId>
                  <version>2.1.1</version>
                  <configuration>
                    <outputDirectory>deployments</outputDirectory>
                    <warName>ROOT</warName>
                  </configuration>
                </plugin>
              </plugins>
            </build>
          </profile>
        </profiles>
      </project>
      

       

      Could someone have a look and tell me what am i doing wrong ??? Thank you guys