1 2 3 4 Previous Next 48 Replies Latest reply on Jan 7, 2013 10:05 AM by srinivas.bijjam

    database binding issue

    srinivas.bijjam

      Hi all

       

         I have two files in deployments folder

                 xxx.ear

                xxx_ds.xml

       

      I removed the datasource settings from standalone-full.xml(except drivers) and setting the same in xxx_ds.xml. My intension is to use the custom ds.xml files rather than standalone-full.xml as we will be writing the datasource settings at installation of our application. We don't want to touch the jboss predefined xml config files and instead to use ds files.

       

      Every thing is fine but getting the following exception because our ear contains some ejb jars which are looking for JNDI Name of the datasource. As ear is deploying first , I am getting the exception.

       

       

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.data-source.java:/sw-dataSource-oraclePool (missing) dependents: [service jboss.deployment.subunit."xxx.ear"."abc_cmp.jar".component.DIInstObj.jdbc.store-manager.INIT, service jboss.deployment.subunit."xxx.ear"."abc1_cmp.jar".component.BusinessObject.jdbc.store-manager.INIT, service jboss.deployment.subunit."xxx.ear"."abc2_cmp.jar".component.EmailService.jdbc.store-manager.INIT, service jboss.deployment.subunit."xxx.ear"."abc3_cmp.jar".component.JobInst.jdbc.store-manager.INIT, JBAS014799: ... and 53 more ]

       

      How to ensure that first deploy the ds.xml , bind the datasource jndi and then .ear?

       

      Also if I remove exampleDs from Standalone-full.xml and related h2 drivers, I am getting JBAS014775:    New missing/unsatisfied dependencies:. I don't want any other examples or predefined stuff in my jboss server . How to remove this error?

       

      Regards

      Srini

        • 1. Re: database binding issue
          nickarls

          I thought *-ds.xml datasources *were* deployed before the applications? All deployments are just dropped in the deployments folder?

           

          Also, what AS version are you on? I tried commenting out all datasources/drivers from a fresh build and I saw no errors on startup at least.

          • 2. Re: database binding issue
            swd847

            In 7.1.1 this will not work properly, there is not real ordering.

             

            In 7.1.2 onwards the deployments are deployed simultaniously, and this should just work, as the missing dependencies should not be reported until after the -ds.xml deployment has deployed.

            • 3. Re: database binding issue
              srinivas.bijjam

              Sorry I missed mentioning Version. It is 7.1.1 Final

              • 4. Re: database binding issue
                srinivas.bijjam

                Dear Douglas

                 

                  I tried removing these two parts from datasources in standalone-full.xml

                 

                                <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>

                 

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

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

                                    </driver>

                 

                Suprisingly it is giving exception and pointing to my xxx.ear

                 

                BAS014775:    New missing/unsatisfied dependencies:

                      service jboss.data-source.java:jboss/datasources/ExampleDS (missing) dependents: [service jboss.deployment.subunit."xxx.ear"."xxx_cmp.jar".component.DIInstObj.jdbc.store-manager.INIT

                • 5. Re: database binding issue
                  nickarls

                  Then you must have some reference to the ExampleDS there, one would think.

                  • 6. Re: database binding issue
                    srinivas.bijjam

                    I searched entire Application Server and my code for ExampleDS but I am not able to find any instance where this is being refered

                    • 7. Re: database binding issue
                      nickarls

                      And there are *no* xml files in the xxx_cmp.jar whatsoever? No ejb2 stuff etc? What does a jar tf of the jar show?

                      • 8. Re: database binding issue
                        swd847

                        ExampleDS is the default for CMP beans if you do not explicitly specify one.

                        1 of 1 people found this helpful
                        • 9. Re: database binding issue
                          srinivas.bijjam

                          Dear Douglas

                           

                              I deployed my application in JBoss AS 7.2.0.Alpha1-SNAPSHOT and under standalone\deployments folders I placed

                                 -- test.ear

                                 --connector.xml

                          Still I am getting the same exception

                          [org.jboss.as.server] (ServerService Thread Pool -- 35) JBAS018559: Deployed "test.ear"

                          [org.jboss.as.server] (ServerService Thread Pool -- 35) JBAS018559: Deployed "connectors.xml"

                          [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

                          JBAS014775:    New missing/unsatisfied dependencies:

                                service jboss.data-source.java:/dataSource-oraclePool (missing) dependents: [service jboss.deployment.subunit."test.ear"."testcmp.jar".component.DIInstObj.jdbc.store-manager.INIT,  JBAS014799: ... and 53 more ]

                           

                          My database configuration in standalone-full.xml

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

                                      <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>

                                           <drivers>

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

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

                                              </driver>

                                              <driver name="ojdbc6" module="com.oracle.ojdbc6">

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

                                                  <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

                                              </driver>

                                              <driver name="sqljdbc4" module="com.sqlServer.jdbc">

                                                  <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>

                                              </driver>

                                          </drivers>

                                      </datasources>

                                  </subsystem>

                           

                          connector.xml


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

                          <datasources>

                          <xa-datasource enabled="true" jndi-name="java:/dataSource-oraclePool" pool-name="dataSource-oraclePool" type="javax.sql.DataSource" use-java-context="true">

                          <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:orcl</xa-datasource-property>

                          <driver>ojdbc6</driver>

                          <xa-pool>

                          <min-pool-size>1</min-pool-size>

                          <max-pool-size>20</max-pool-size>

                          <prefill>true</prefill>

                          <is-same-rm-override>false</is-same-rm-override>

                          <no-tx-separate-pools>true</no-tx-separate-pools>

                          </xa-pool>

                          <security>

                          <user-name>test</user-name>

                          <password>test</password>

                          </security>

                          <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

                          </xa-datasource>

                          </datasources>

                           

                          my jboss-deployment-structure.xml

                           

                          <jboss-deployment-structure>

                          <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

                          <deployment>

                                  <dependencies>

                                              <module name="javaee.api" export="true"/>

                                              <module name="sun.jdk" export="true"/>

                             <module name="javax.api" export="true"/>

                                              <module name="com.oracle.ojdbc6" export="true"/>

                                              <module name="com.sqlServer.jdbc" export="true"/>

                                  </dependencies>

                             </deployment>  

                          </jboss-deployment-structure>

                           

                          Regards

                          Srini

                          • 10. Re: database binding issue
                            srinivas.bijjam

                            Dear Douglas

                             

                                Even in JBoss AS 7.2.0.Alpha1-SNAPSHOT, binding is not happening. Even thought ds.xml deployed prior to ear file but the jars which contains cmp's are still throwing exception that could not able to locate the datasource

                                Any changes do we need to make to the configuration files?

                             

                            Still I am getting same error

                            JBAS014775:    New missing/unsatisfied dependencies:

                                  service jboss.data-source.java:/sw-dataSource-oraclePool (missing) dependents: [service jboss.deployment.subunit."xxx.ear"."abc_cmp.jar".component.DIInstObj.jdbc.store-manager.INIT, service jboss.deployment.subunit."xxx.ear"."abc1_cmp.jar".component.BusinessObject.jdbc.store-manager.INIT, service jboss.deployment.subunit."xxx.ear"."abc2_cmp.jar".component.EmailService.jdbc.store-manager.INIT, service jboss.deployment.subunit."xxx.ear"."abc3_cmp.jar".component.JobInst.jdbc.store-manager.INIT, JBAS014799: ... and 53 more

                             

                             

                            But Log file says

                            [org.jboss.as.server] (ServerService Thread Pool -- 35) JBAS018559: Deployed "xxx-ds.xml"

                            [org.jboss.as.server] (ServerService Thread Pool -- 35) JBAS018559: Deployed "xxx.ear"

                             

                            Still Binding is not happening

                             

                            Standalone-full.xml

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

                                        <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>

                                            <drivers>

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

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

                                                </driver>

                                                <driver name="ojdbc6" module="com.oracle.ojdbc6">

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

                                                    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

                                                </driver>

                                                <driver name="sqljdbc4" module="com.sqlServer.jdbc">

                                                    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>

                                                </driver>

                                            </drivers>

                                        </datasources>

                                    </subsystem>

                             

                              xxx_ds.xml is

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

                            <datasources>

                            <xa-datasource enabled="true" jndi-name="java:/sw-dataSource-oraclePool" pool-name="sw-dataSource-oraclePool" type="javax.sql.DataSource" use-java-context="true">

                            <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:orcl</xa-datasource-property>

                            <driver>ojdbc6</driver>

                            <xa-pool>

                            <min-pool-size>1</min-pool-size>

                            <max-pool-size>20</max-pool-size>

                            <prefill>true</prefill>

                            <is-same-rm-override>false</is-same-rm-override>

                            <no-tx-separate-pools>true</no-tx-separate-pools>

                            </xa-pool>

                            <security>

                            <user-name>xxxx</user-name>

                            <password>xxxx</password>

                            </security>

                            <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

                            </xa-datasource>

                             

                            </datasources>

                            • 11. Re: database binding issue
                              swd847

                              Data sources have to be defined in a -ds.xml file.

                               

                              This is actually a bit confusing at the moment, as the scanner will pick up arbirtrary XML files, however unless they match certain pre-definined naming patterns they will not actually be parsed.

                               

                              Stuart

                              1 of 1 people found this helpful
                              • 12. Re: database binding issue
                                srinivas.bijjam

                                Dear Stuart

                                    The name of my file is xxx-ds.xml. I am sorry it is typo error in my previous comments

                                • 13. Re: database binding issue
                                  jaikiran

                                  <driver>ojdbc6</driver>

                                  How have you deployed/configured the ojdbc6 driver?

                                  • 14. Re: database binding issue
                                    jaikiran

                                    Also please attach the entire server.log that you see against the latest nightly build with your application and the -ds.xml deployed.

                                    1 2 3 4 Previous Next