1 Reply Latest reply on Dec 16, 2013 3:07 AM by Ashim Mishra

    Unable to deploy my sample application. problem : JBAS014771: Services with missing/unavailable dependencies

    vidyasagar perivemula Newbie

      Hello,

      Im new to Jboss and i successfully deployed some struts, ejb3.0, sevlets, jsp application in JBoss 7.1 server using Eclipse Indigo. But i am unable to deploy some sample JPA programs or Datasource samples. i have installed a oracle driver and created a data source using admin console(localhost:9990).I have tested using test connections and it worked.  when i deployed the application in server i got an error message as bellow,

      03:24:28,307 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "CRUDEjbProject.jar" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"CRUDEjbProject.jar#CRUD\"jboss.naming.context.java.OracleDataSourceMissing[jboss.persistenceunit.\"CRUDEjbProject.jar#CRUD\"jboss.naming.context.java.OracleDataSource]"]}

       

      when i goggled, i noticed as - 1) When we create driver there was no entry in standalone.xml file. 2) When i created Datasource name in the console then i noticed only "datasource" entry was created but no driver entry in standalone.xml file. So i have added driver entry manually. And i also created a directory structure and placed module.xml file(C:\jboss\modules\oracle\ojdbc6\main).

       

      standalone.xml :

      ------------------------------------------------------------------------------------------------------------------

      <datasource jta="true" jndi-name="java:jboss/datasources/OracleSDS" pool-name="OracleSDS" enabled="true" use-ccm="true">

                          <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>

                          <driver-class>oracle.jdbc.OracleDriver</driver-class>

                          <driver>ojdbc6.jar</driver>

                          <security>

                              <user-name>hr</user-name>

                              <password>hr</password>

                          </security>

                          <validation>

                              <validate-on-match>false</validate-on-match>

                              <background-validation>false</background-validation>

                          </validation>

                          <statement>

                              <share-prepared-statements>false</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="ojdbc6.jar" module="com.oracle.ojdbc6">

                              <xa-datasource-class>oracle.jdbc.driver.OracleDriver</xa-datasource-class>

                          </driver>

                      </drivers>

                  </datasources>

      -----------------------------------------------------------------------------------------------------------------------------------------------

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

      - <module xmlns="urn:jboss:module:1.0" name="com.oracle.ojdbc6">

      - <resources>

        <resource-root path="ojdbc6.jar" />

        </resources>

      - <dependencies>

        <module name="javax.api" />

        <module name="javax.transaction.api" />

        </dependencies>

        </module>

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

        persistence.xml

        <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="CRUD">

               <jta-data-source>java:jboss/datasources/OracleSDS</jta-data-source>

               <non-jta-data-source>OracleDataSource</non-jta-data-source>

               <class>com.ibytecode.entities.Regions</class>

          <properties>

                  <property name="openjpa.jdbc.DBDictionary" value="oracle(DriverVendor=oracle)" />

          </properties>

          </persistence-unit>

      </persistence>

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

      I have restated the server and deleted and added again the project but i still got the same error. start the server i could able to view dirver and dataasource was created sucessfully in console log file.

      03:13:38,097 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "ojdbc6.jar"

      03:13:38,721 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)

      03:13:39,144 INFO  [org.jboss.as.server] (HttpManagementService-threads - 1) JBAS018559: Deployed "ojdbc6.jar"

      03:18:49,549 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/OracleSDS]

      ---------------------------------------------------------------------------------------------

      03:47:45,192 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "CRUDEjbProject.jar" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"CRUDEjbProject.jar#CRUD\"jboss.naming.context.java.OracleDataSourceMissing[jboss.persistenceunit.\"CRUDEjbProject.jar#CRUD\"jboss.naming.context.java.OracleDataSource]"]}

      03:47:45,201 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.naming.context.java.OracleDataSource (missing) dependents: [service jboss.persistenceunit."CRUDEjbProject.jar#CRUD"]

       

      03:47:45,212 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"CRUDEjbProject.jar#CRUD\"jboss.naming.context.java.OracleDataSourceMissing[jboss.persistenceunit.\"CRUDEjbProject.jar#CRUD\"jboss.naming.context.java.OracleDataSource]"]}}}

      03:47:45,276 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment CRUDEjbProject.jar in 60ms

      03:47:45,280 INFO  [org.jboss.as.controller] (MSC service thread 1-4) JBAS014774: Service status report

      JBAS014776:    Newly corrected services:

            service jboss.naming.context.java.OracleDataSource (new available)

       

      But strange i still got the error. im stuck in here from 2 days and i need a help to move further.  i have just created a dummy bean with following 2 lines

      `

        @PersistenceContext(unitName = "CRUD")

          private EntityManager entityManager;

       

      Please let me know if you need any information from my end to solve this issue for me. Thanks guys,

      Sagar.