5 Replies Latest reply on Feb 26, 2013 7:27 AM by brentdouglas

    Datasource configuration in AS built from current master

    brentdouglas

      Hi,

       

      I looking into a leak that existed in 7.1.3 and I am trying to see if it still exists in the current master. I have previously used this datasource configuration:

       

      115         <subsystem xmlns="urn:jboss:domain:datasources:1.1">
      116             <datasources>
      117                 <datasource jndi-name="java:jboss/datasources/PlutoTestDS" pool-name="java:jboss/datasources/PlutoTestDS" enabled="true" use-java-context="true">
      118                     <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
      119                     <driver>h2</driver>
      120                     <security>
      121                         <user-name>sa</user-name>
      122                         <password>sa</password>
      123                     </security>
      124                 </datasource>
      125                 <xa-datasource jndi-name="java:jboss/datasources/PlutoMainDS" pool-name="java:jboss/datasources/PlutoMainDS" enabled="true">
      126                     <xa-datasource-property name="DatabaseName">
      127                         something
      128                     </xa-datasource-property>
      129                     <xa-datasource-property name="ServerName">
      130                         something
      131                     </xa-datasource-property>
      132                     <xa-datasource-property name="User">
      133                         something
      134                     </xa-datasource-property>
      135                     <xa-datasource-property name="Password">
      136                         something
      137                     </xa-datasource-property>
      138                     <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
      139                     <driver>postgresql-8.4-702.jdbc4.jar</driver>
      140                 </xa-datasource>
      141                 <xa-datasource jndi-name="java:jboss/datasources/MinervaDS" pool-name="java:jboss/datasources/MinervaDS" enabled="true">
      142                     <xa-datasource-property name="DatabaseName">
      143                         something
      144                     </xa-datasource-property>
      145                     <xa-datasource-property name="ServerName">
      146                         something
      147                     </xa-datasource-property>
      148                     <xa-datasource-property name="User">
      149                         something
      150                     </xa-datasource-property>
      151                     <xa-datasource-property name="Password">
      152                         something
      153                     </xa-datasource-property>
      154                     <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
      155                     <driver>postgresql-8.4-702.jdbc4.jar</driver>
      156                 </xa-datasource>
      157                 <drivers>
      158                     <driver name="h2" module="com.h2database.h2">
      159                         <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
      160                     </driver>
      161                 </drivers>
      162             </datasources>
      163         </subsystem>
      
      

       

      And have been copying the postgres driver jar into the deployments directory. If I try and use this config now the driver is not picked up as being associated with the datasource. e.g.

       

      38511 10:53:13,023 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.1.3.Final
      38512 10:53:13,061 INFO  [org.apache.coyote.http11] (MSC service thread 1-8) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/127.0.0.1:8080
      38513 10:53:13,061 INFO  [org.apache.coyote.ajp] (MSC service thread 1-7) JBWEB003046: Starting Coyote AJP/1.3 on ajp-/127.0.0.1:8009
      38514 10:53:13,076 INFO  [org.apache.coyote.http11] (MSC service thread 1-8) JBWEB003000: Coyote HTTP/1.1 starting on: http-/127.0.0.1:8080
      38515 10:53:13,360 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 37) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities wi>
      38516 10:53:13,368 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 37) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities wi>
      38517 10:53:13,474 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory /home/brent/work/jboss-as/build/target/jboss-as-8.0.0.Alpha1-SNAPSHOT/standalone/de>
      38518 10:53:13,492 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "postgresql-8.4-702.jdbc4.jar" (runtime-name: "postgresql-8.4-702.jdbc4.jar")
      38519 10:53:13,493 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "postgresql-9.1-901.jdbc4.jar" (runtime-name: "postgresql-9.1-901.jdbc4.jar")
      38520 10:53:13,511 INFO  [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on 127.0.0.1:9999
      38521 10:53:13,512 INFO  [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on 127.0.0.1:4447
      38522 10:53:13,861 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 8.4)
      38523 10:53:13,862 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.1)
      38524 10:53:18,856 WARN  [org.hornetq.journal] (MSC service thread 1-7) HQ142001: You have a native library with a different version than expected
      38525 10:53:18,857 WARN  [org.jboss.as.messaging] (MSC service thread 1-7) JBAS011600: AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
      38526 10:53:18,910 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) JBAS010400: Bound data source [java:jboss/datasources/PlutoTestDS]
      38527 10:53:19,019 INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221001: live server is starting with configuration HornetQ Configuration (clustered=true,backup=false,sharedStore=true,journalDirectory=/home/brent/work/jboss>
      38528 10:53:19,024 INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221008: Waiting to obtain live lock
      38529 10:53:19,081 INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221017: Using NIO Journal
      38530 10:53:19,252 INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221039: Waiting to obtain live lock
      38531 10:53:19,252 INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221040: Live Server Obtained live lock
      38532 10:53:19,518 INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221024: Started Netty Acceptor version 3.6.2.Final-c0d783c 127.0.0.1:5445 for CORE protocol
      38533 10:53:19,525 INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221024: Started Netty Acceptor version 3.6.2.Final-c0d783c 127.0.0.1:5455 for CORE protocol
      38534 10:53:19,527 INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221009: Server is now live
      38535 10:53:19,527 INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221003: HornetQ Server version 2.3.0.CR1 (buzzzzz!, 122) [878f4b7e-7fa6-11e2-b74a-bf80406a70e8].
      38536 10:53:19,537 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 61) HQ221005: trying to deploy queue jms.queue.simpleTaskRunnerQueue
      38537 10:53:19,693 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 61) JBAS011601: Bound messaging object to jndi name java:jboss/simpleTaskRunnerQueue
      38538 10:53:19,723 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 64) JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory
      38539 10:53:19,724 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 63) HQ221005: trying to deploy queue jms.queue.distributedTaskRunnerBQueue
      38540 10:53:19,729 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 63) JBAS011601: Bound messaging object to jndi name java:jboss/distributedTaskRunnerBQueue
      38541 10:53:19,730 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 62) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
      38542 10:53:19,730 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 60) HQ221005: trying to deploy queue jms.queue.distributedTaskRunnerAQueue
      38543 10:53:19,733 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 60) JBAS011601: Bound messaging object to jndi name java:jboss/distributedTaskRunnerAQueue
      38544 10:53:19,749 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-5) JBAS010406: Registered connection factory java:/JmsXA
      38545 10:53:19,834 INFO  [org.hornetq.ra] (MSC service thread 1-5) HornetQ resource adaptor started
      38546 10:53:19,836 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-5) IJ020002: Deployed: file://RaActivatorhornetq-ra
      38547 10:53:19,844 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-7) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
      38548 10:53:19,935 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) JBAS018559: Deployed "postgresql-9.1-901.jdbc4.jar" (runtime-name : "postgresql-9.1-901.jdbc4.jar")
      38549 10:53:19,936 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) JBAS018559: Deployed "postgresql-8.4-702.jdbc4.jar" (runtime-name : "postgresql-8.4-702.jdbc4.jar")
      38550 10:53:19,939 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
      38551 JBAS014775:    New missing/unsatisfied dependencies:
      38552       service jboss.jdbc-driver.postgresql-8_4-702_jdbc4_jar (missing) dependents: [service jboss.driver-demander.java:jboss/datasources/PlutoMainDS, service jboss.data-source.java:jboss/datasources/PlutoMainDS, service jboss.driv>
      38553 
      38554 10:53:19,955 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
      38555 10:53:19,956 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
      38556 10:53:19,956 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 8.0.0.Alpha1-SNAPSHOT "TBD" started (with errors) in 13236ms - Started 241 of 343 services (8 services failed or missing dependencies, 119 services ar>
      

       

      When I try to deploy my app it fails with the message:

       

      "Services that may be the cause:" => ["jboss.jdbc-driver.postgresql-8_4-702_jdbc4_jar"
      

       

      Can anyone tell me what I have to do to get this to deploy?

        • 1. Re: Datasource configuration in AS built from current master
          nickarls

          How have you deployed the pgsql driver jar?

          • 2. Re: Datasource configuration in AS built from current master
            jaikiran

            It's  a bug in current master https://issues.jboss.org/browse/AS7-6565.

            • 3. Re: Datasource configuration in AS built from current master
              nickarls

              It fails even if you try a <driver>jboss.jdbc-driver.postgresql-8_4-702_jdbc4_jar</driver>?

              • 4. Re: Datasource configuration in AS built from current master
                lafr

                No, you have to add the internal driver name and the major and minor version also whic leads to

                <driver>jboss.jdbc-driver.postgresql-8.4-702.jdbc4.jar_org.postgresql.Driver_8_4</driver>

                    {                                                                            
                        "driver-name" => "postgresql-8.4-702.jdbc4.jar_org.postgresql.Driver_8_4",
                        "deployment-name" => "postgresql-8.4-702.jdbc4.jar_org.postgresql.Driver_8_4",
                        "driver-module-name" => undefined,                                       
                        "module-slot" => undefined,                                              
                        "driver-datasource-class-name" => undefined,                             
                        "driver-xa-datasource-class-name" => undefined,                          
                        "driver-class-name" => "org.postgresql.Driver",                          
                        "driver-major-version" => 8,                                             
                        "driver-minor-version" => 4,                                             
                        "jdbc-compliant" => false                                                
                    },                                                                           

                 

                That's just underlining the problem I have with the change of AS7-6565.

                But I hope for a better solution as jaikiran reopened this jira request and is working on it.

                1 of 1 people found this helpful
                • 5. Re: Datasource configuration in AS built from current master
                  brentdouglas

                  Thanks guys,

                   

                  I had the answer before my post got approved but I am glad this is reported as a bug.

                   

                  To be clear the driver declaration needed to be changed to the one pointed out by Frank:

                   

                  <driver>postgresql-8.4-702.jdbc4.jar_org.postgresql.Driver_8_4</driver>

                   

                  Brent