4 Replies Latest reply on Nov 30, 2004 1:36 AM by puneetkapahi

    interfacing JBoss with postgres

    puneetkapahi

      hi,

      I have just begun my career as a developer and am new to the intricacies of the j2ee world.


      I am currently working on the migration of an application from Websphere6.1 and Oracle 9i to JBoss and PostgreSQL 7.4.5.

      My application is up on the server but I am not able to connect to the database.Anyone please tell me where all the configuration will happen in JBoss to achieve this.Step by step guidelines will be extremely helpful.

      I am in deep shit now as I am the only one handling this and my boss is really pressing on me.Please take this as SOS call from one of the junior members and dont ignore it.Help or suggestions of any kind are welcome.

      Thanks in anticipation.

        • 1. Re: interfacing JBoss with postgres
          beyarecords

          what version of jboss are you using?

          Andrew

          • 2. Re: interfacing JBoss with postgres
            puneetkapahi

            I am using JBoss 3.2.5 and PostgreSQL 7.4.5.

            • 3. Re: interfacing JBoss with postgres
              • 4. Re: interfacing JBoss with postgres
                puneetkapahi

                Hi,

                I made the changes in jboss.xml and ejb-jar.xml accordinglyBut I forgot to mention that I was getting :


                ObjectName: jboss.mq:service= StateManager state: NOTYETINSTALLED

                Also when I start run.sh I get messages on my postgres console(on a remote system).

                It tries to create tables jms_messages and jms_transaction ....but if I try to restart the server it gives:

                relation "jms_messages"already exists
                current transaction is aborted,command ignored until end of transaction block

                which is understandable though because of the
                CREATE_TABLES_ON_STARTUP = TRUE

                in postgres-jdbc2-service.xml in deploy/jms.I have set it to false .no communication seems to happen thereafter.

                Please give some steps on how to go about this.


                I have made the following changes already:

                1) standardjbosscmp-jdbc.xml and standardjaws.xml

                <jbosscmp-jdbc>


                jdbc/Acws
                <datasource-mapping>PostgreSQL 7.4.5</datasource-mapping>

                <create-table>true</create-table>



                </jbosscmp-jdbc>


                jdbc/Acws
                <type-mapping>PostgreSQL 7.4.5</type-mapping>

                <create-table>true</create-table>
                .
                .
                . .
                .




                2)postgres-ds.xml



                <local-tx-datasource>
                <jndi-name>jdbc/Acws</jndi-name>
                <connection-url>jdbc:postgresql://172.19.16.135:5432/ACWS</connection-url>
                <driver-class>org.postgresql.Driver</driver-class>
                <user-name>postgres</user-name>
                satyam
                <!-- sql to call when connection is created
                <new-connection-sql>some arbitrary sql</new-connection-sql>
                -->

                <!-- sql to call on an existing pooled connection when it is obtained from pool
                <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
                -->

                </local-tx-datasource>



                and...

                3) the following entry in login-config.xml

                <application-policy name = "PostgreSQLDbRealm">

                <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
                flag = "required">
                <module-option name = "principal">postgres</module-option>
                <module-option name = "userName">postgres</module-option>
                <module-option name = "password"></module-option>
                <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=java:/jdbc/Acws</module-option>
                </login-module>

                </application-policy>



                Please reply...