4 Replies Latest reply on Dec 1, 2013 10:15 AM by 222222

    jboss 6.1.1 eap and progresql driver (jar) ->JBAS010404

    zatopek zatopek Newbie

      Hello

       

      I want to connect my EAP 6.1 to postgresql.

      I am using 1.7 jdk

      i have download the postgresql driver from http://jdbc.postgresql.org/download/postgresql-9.3-1100.jdbc41.jar

      i have make one module

      i have add to jboss using cli:

      [standalone@localhost:9999 /] /subsystem=datasources/jdbc-driver=postgresqlNOXA:add(driver-name=postgresqlNOXA, driver-class-name=org.postgresql.Driver, driver-module-name=org.postgresql)

      {"outcome" => "success"}

       

      but whe i start my jboss appears this error.

      16:41:06,454 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010404: Implementaci¾n de controladro que no cumple con los requerimientos de JDBC class org.postgresql.Driver (versi¾n 9.3)

       

      If i try to make one datasource using the consle appears thsi error:

      16:41:06,940 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP  6.1.1.GA (AS 7.2.1.Final-redhat-10) inici¾ en 2358ms - Inici¾ 129 de 184 servic ios (53 servicios son pasivos o por demanda)

      16:41:49,036 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (HttpManagementService-threads - 1) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Could not create connection

              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLo calManagedConnection(LocalManagedConnectionFactory.java:285) [ironjacamar-jdbc-1.0.19.Final-redhat-2.jar:1.0.19.Final-redhat-2]

      ...................

              at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]

      Caused by: javax.resource.ResourceException: Wrong driver class [class org.postgresql.Driver] for this connection URL [jdbc:postgres://192.168.1.55:5432/mydb]

              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:259) [ironjacamar-jdbc-1.0.19.Final-redhat-2.jar:1.0.19.Final-redhat-2]

              ... 34 more

       

      Can you help me?

       

      thanks

        • 2. Re: jboss 6.1.1 eap and progresql driver (jar) ->JBAS010404
          zatopek zatopek Newbie

          I think that is ok

          into my jobss/modules i have org/postgresql/main

          into this directory i have the jar and the module.xml file:

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

          <module xmlns="urn:jboss:module:1.0" name="org.postgresql">

            <resources>

              <resource-root path="postgresql-9.3-1100.jdbc4.jar"/>

            </resources>

            <dependencies>

              <module name="javax.api"/>

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

            </dependencies>

          </module>

          • 3. Re: jboss 6.1.1 eap and progresql driver (jar) ->JBAS010404
            222222 Newbie

            no,

            postgresql-9.3-1100.jdbc4.jar

            it not work, too

            :-(

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

            <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">

                <persistence-unit name="jpa00" transaction-type="JTA">

                    <provider>org.hibernate.ejb.HibernatePersistence</provider>

                    <class>jpa00.BssArcAttr</class>

                    <class>jpa00.BssArcAttr0</class> 

            <properties>

            <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>

            <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>

            <property name="hibernate.connection.url" value="jdbc:postgresql://192.168.0.100/docflow"/>

            <property name="hibernate.connection.username" value="jboss"/>

            <property name="hibernate.connection.password" value="12345678"/>

            <property name="hibernate.default_schema" value="system"/>

            </properties>

                </persistence-unit>

            </persistence>

             

            Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Specified JDBC Driver org.postgresql.Driver could not be loaded

            Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [org.postgresql.Driver]

            • 4. Re: jboss 6.1.1 eap and progresql driver (jar) ->JBAS010404
              222222 Newbie

              I work it

               

              E:\work\JAVA\jpa00\src\META-INF\persistence.xml :

               

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

              <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">

                  <persistence-unit name="jpa00" transaction-type="JTA">

                      <provider>org.hibernate.ejb.HibernatePersistence</provider>

                     <jta-data-source>java:/docflow</jta-data-source>

                      <class>jpa_00.BssArcAttr</class>

                      <class>jpa_00.BssArcAttr0</class>

              <!--       

              <properties>

              <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>

              <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>

              <property name="hibernate.connection.url" value="jdbc:postgresql://192.168.0.100/docflow"/>

              <property name="hibernate.connection.username" value="jboss"/>

              <property name="hibernate.connection.password" value="12345678"/>

              <property name="hibernate.default_schema" value="system"/>

              </properties>

              -->

                  </persistence-unit>

              </persistence>

               

              In file E:\workSOFT\JBOSS\jboss-eap-6.1\standalone\configuration\standalone.xml i have :

               

              <datasources>

                              <datasource jta="false" jndi-name="java:/docflow" pool-name="docflow" enabled="true" use-ccm="false">

                                  <connection-url>jdbc:postgresql://localhost/docflow</connection-url>

                                  <driver-class>org.postgresql.Driver</driver-class>

                                  <driver>postgresql</driver>

                                  <security>

                                      <user-name>jboss</user-name>

                                      <password>jboss</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="postgresql" module="org.postgresql">
                                      <xa-datasource-class>org.postgresql.Driver</xa-datasource-class>
                                  </driver>
                              </drivers>
              </datasources>

               

              E:\workSOFT\JBOSS\jboss-eap-6.1\modules\system\layers\base\org\postgresql\main\module.xml :

               

              <module xmlns="urn:jboss:module:1.1" name="org.postgresql">

                  <resources>

                      <resource-root path="postgresql-9.3-1100.jdbc4.jar"/>

                      <!-- Insert resources here -->

                  </resources>

                  <dependencies>

                      <module name="javax.api"/>

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

                  </dependencies>

              </module>