1 2 Previous Next 16 Replies Latest reply on Feb 26, 2005 7:03 AM by weegah Go to original post
      • 15. Re: JBoss plus PostgreSQL

        I found the problem, first the property password is case-sensitive


        The content does not matter (in the case accessing it from the localhost), but it has not the be empty, take care :)

        And the next thing i got was another error message while starting up:

        [INFO,PostgresDS] Connection refused. Check that the hostname and port is correct, and that the postmaster is running with the -i flag, which enables TCP/IP networking.

        So this is pretty easy to solve, thanks to the good error message! I can only highly recommend to turn on logging:


        otherwise the startup just hangs without any helpful message.

        -- Niko

        • 16. Re: JBoss plus PostgreSQL

          if your application is web application then :-

          In web.xml add the following lines:-

          <resource-ref >

          In the C:\jboss-3.2.2\server\YourApp\deploy , you must create the postgres-ds.xml file :

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

          <!-- ===================================================================== -->
          <!-- -->
          <!-- JBoss Server Configuration -->
          <!-- -->
          <!-- ===================================================================== -->

          <!-- $Id: postgres-ds.xml,v 2003/09/05 16:38:24 patriot1burke Exp $ -->

          <connection-url>jdbc ostgresql://yourserver ort/appcontext</connection-url>

          <!-- 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>


          And finally, you have to create a jboss-web.xml in your WEB-INF app directory as follows :

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

          Then , in order to get the DS object, you have this code (using JNDI) :

          ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/MyDSName");

          1 2 Previous Next