2 Replies Latest reply on Feb 24, 2006 9:52 AM by yantriki

    JBoss is not using data from my postgres-ds.xml

    mglowacki

      Hi

      I want to connect to postgres in my stateless session, I have put postgres-ds.xml in deploy directory already, and I have following problem. I have username and password "root" in my postgres-ds.xml, and application is trying to connect with username "postgres" and no password and I get the error (from server log):

      [...]
      2005-12-13 00:52:32,531 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=postgres, password=--hidden--}
      2005-12-13 00:52:32,546 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.postgresql.util.PSQLException: Connection refused: FATAL: password authentication failed for user "postgres".)
      [...]

      and that's my postgres-ds.xml:


      <local-tx-datasource>
      <!-- jboss:service=Postgres -->
      <jndi-name>PostgresDS</jndi-name>
      <connection-url>jdbc:postgresql://localhost:5432/my_db</connection-url>
      <!-- driver-class>org.postgresql.Driver</driver-class -->
      <driver-class>org.postgresql.jdbc3.Jdbc3PoolingDataSource</driver-class>
      <user-name>root</user-name>
      root
      <security-domain>PostgresDbRealm</security-domain>


      <type-mapping>PostgreSQL 8.0</type-mapping>


      </local-tx-datasource>




      So I believe that user-name from this file is not used, why?

        • 1. Re: JBoss is not using data from my postgres-ds.xml
          tuxsy

          I have the same problem by trying to connect to a MySQL Database.

          If I change the server address in my mysql-ds.xml JBoss fail to connect to the old_ip_address ussing currnent user. Buy if I change the username JBoss recognizes it and fail connecting to old_ip_address ussing new_user.

          Raro raro raro

          • 2. Re: JBoss is not using data from my postgres-ds.xml

            Try removing

            <security-domain>PostgressDBRealm</security-domain>


            and add

            <password></password>


            to you postgress-ds.xml file


            If you use security domain, the configuration in ${jboss.server.home.dir}/conf/login-config.xml file is used for authentication.

            Vivek