1 2 3 4 Previous Next 48 Replies Latest reply on Jan 7, 2013 10:05 AM by srinivas.bijjam Go to original post
      • 30. Re: database binding issue
        jaikiran

        Srinivas Reddy Bijjam wrote:

         

        Jaikiran

         

          I am still getting the same error

        I'm not trying to be annoying, but it's not the same error (take a closer look) and that's why I and others have been asking for the new logs/exceptions and configurations. Thank you for posting the new logs, I'll get to it in a while if no one else gets to it before me.

        • 31. Re: database binding issue
          nickarls

          What does the CLI command /subsystem=datasources:installed-drivers-list show?

          • 32. Re: database binding issue
            srinivas.bijjam

            Dear Nicklas

             

            Here is the list

             

            [standalone@localhost:9999 /] /subsystem=datasources:installed-drivers-list

            {

                "outcome" => "success",

                "result" => [

                    {

                        "driver-name" => "h2",

                        "deployment-name" => undefined,

                        "driver-module-name" => "com.h2database.h2",

                        "module-slot" => "main",

                        "driver-datasource-class-name" => "",

                        "driver-xa-datasource-class-name" => "org.h2.jdbcx.JdbcDataSource",

                        "driver-class-name" => "org.h2.Driver",

                        "driver-major-version" => 1,

                        "driver-minor-version" => 3,

                        "jdbc-compliant" => true

                    },

                    {

                        "driver-name" => "ojdbc6",

                        "deployment-name" => undefined,

                        "driver-module-name" => "com.oracle.ojdbc6",

                        "module-slot" => "main",

                        "driver-datasource-class-name" => "",

                        "driver-xa-datasource-class-name" => "oracle.jdbc.xa.client.OracleXADataSource",

                        "driver-class-name" => "oracle.jdbc.OracleDriver",

                        "driver-major-version" => 11,

                        "driver-minor-version" => 2,

                        "jdbc-compliant" => true

                    }

                ]

            }

            • 33. Re: database binding issue
              nickarls

              How about with a different namespace in the -ds.xml file?

               

              <?xml version="1.0" encoding="UTF-8"?>
              <datasources xmlns="http://www.jboss.org/ironjacamar/schema">

              • 34. Re: database binding issue
                srinivas.bijjam

                Dear Nicklas

                 

                  I am getting same error even after modifying ds.xml as said by you

                 

                JBAS014775:    New missing/unsatisfied dependencies:

                      service jboss.data-source.java:jboss/sw-dataSource-oraclePool (missing) dependents: [service jboss.deployment.subunit."MyAdminServer.ear"."dqrulescmp.jar".component.DIInstObj.jdbc.store-manager.INIT, service jboss.deployment.subunit."MyAdminServer.ear"."ctorcmp.jar".component.BusinessObject.jdbc.store-manager.INIT, service jboss.deployment.subunit."MyAdminServer.ear"."servicescmp.jar".component.EmailService.jdbc.store-manager.INIT, service jboss.deployment.subunit."MyAdminServer.ear"."jobscmp.jar".component.JobInst.jdbc.store-manager.INIT, JBAS014799: ... and 53 more ]

                • 35. Re: database binding issue
                  nickarls

                  Tried a sample on a fresh 7.2.0:

                  deployed this in standalone/deployment

                   

                  <?xml version="1.0" encoding="UTF-8"?>
                  <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">
                     <datasource jndi-name="java:jboss/datasources/testDS"
                        pool-name="{artifactId}" 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>
                  </datasources>
                  
                  

                   

                  and a simple WAR with a 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="primary">
                        <jta-data-source>java:jboss/datasources/testDS</jta-data-source>
                        <properties>
                           <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                           <property name="hibernate.show_sql" value="false" />
                        </properties>
                     </persistence-unit>
                  </persistence>
                  
                  

                   

                  and a simple servlet like

                   

                   

                  @WebServlet(urlPatterns = "/test")
                  public class Test extends HttpServlet
                  {
                     @PersistenceContext
                     EntityManager entityManager;
                  
                      @Override
                     protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
                     {
                        System.out.println(entityManager);
                     }
                    
                  }
                  
                  

                   

                   

                  And when accessing the servlet, the object is outputted.

                  • 36. Re: database binding issue
                    srinivas.bijjam

                    Dear Nicklas

                     

                    I observed one interesting thing in the log

                     

                    When I deploy using -ds.xml , the binding is happening like below. Missing "java:jboss/" in the jndi-name of datasource.

                     

                     

                    23:06:48,640 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [sw-dataSource-oraclePool]

                    23:06:48,640 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [sw-schedulerDataSource-oraclePool]

                     

                     

                     

                     

                    But the same is clearly visable when I remove -ds.xml and configure the database using standalone-full.xml

                     

                     

                    23:14:08,875 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/sw-dataSource-oraclePool]

                    23:14:08,875 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/sw-schedulerDataSource-oraclePool]

                    • 37. Re: database binding issue
                      nickarls

                      Strange, with the -ds.xml file I get a

                       

                      thread 1-4) JBAS010400: Bound data source [jboss/datasources/testDS]

                       

                      from a resonably fresh upstream master.

                      • 38. Re: database binding issue
                        jaikiran

                        Srinivas, which exact build are you using? That one looks like a bug if it's stripping the java:jboss/ namespace.

                        • 39. Re: database binding issue
                          nickarls

                          Tried latest upstream master, deploying a test-ds.xml with

                           

                          <datasource jndi-name="java:jboss/datasources/testDS"

                           

                          gives an output of

                           

                          JBAS010400: Bound data source [jboss/datasources/testDS]

                          • 40. Re: database binding issue
                            srinivas.bijjam

                            Jai Kiran

                             

                              I have taken nighty build yesterday (JBoss AS 7.2.0.Alpha1-SNAPSHOT )

                             

                            Regards

                            Srini

                            • 41. Re: database binding issue
                              nickarls

                              What does the JNDI name in the log say when you deploy the example I posted a few posts back as a test-ds.xml?

                              • 42. Re: database binding issue
                                jaikiran

                                Could you also quickly try and see if it works with non-xa datasource via config-ds.xml?

                                • 43. Re: database binding issue
                                  nickarls

                                  I tried in my test to make it an xa-datasource and the output was

                                   

                                  JBAS010400: Bound data source [jboss/datasources/testDS]

                                  • 44. Re: database binding issue
                                    maeste

                                    It's a bug in -ds.xml deployment. See https://issues.jboss.org/browse/AS7-6266 (there is already pull requests fixing it)

                                    Please consider to use datasource definition inside standalone.xml and domain.xml

                                     

                                    regards

                                    S.