3 Replies Latest reply on Jan 24, 2003 7:25 AM by wasihasi

    JBoss-3.0.4 and postgres configuration

    hanland

      Hi,
      I am very new to JBoss and am having trouble configuring the DatabaseServerLoginModule using postgres. The problem is that JBoss running under a debugger does not find my dsJndiName.

      The story so far, with a clean install of 3.0.4 I have edited server/deploy/conf/login-conf.xml and added a new policy :-

      <application-policy name = "PostgresDbRealm">

      <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
      <module-option name = "dsJndiName">PostgresDS</module-option>

      .....

      </login-module>

      </application-policy>

      I have copied the example postgres-service.xml to the same conf directory


      <depends optional-attribute-name="ManagedConnectionFactoryName">
      <!--embedded mbean-->

      <!-- ========== Set the JndiName ======================= -->
      PostgresDS


      <config-property name="ConnectionURL" type="java.lang.String">jdbc:postgresql://192.168.40.3:5432/testDB</config-property>
      <config-property name="DriverClass" type="java.lang.String">org.postgresql.Driver</config-property>
      <!--set these only if you want only default logins, not through JAAS -->
      <config-property name="UserName" type="java.lang.String"></config-property>
      <config-property name="Password" type="java.lang.String"></config-property>




      I am having trouble tying up the jndi names. The dsJndiName comes through to the debugger but when the DatabaseServerLoginModule does a lookup on it, it fails. I have under the debugger tried, lookup combinations of java:/PostgresDS etc, but no luck .......

      I had this working, but no luck now ....

      Any help please ........

      Regards

      /Dominic

        • 1. Re: JBoss-3.0.4 and postgres configuration
          jpoley

          can you verify that you can connect to postgresql on that ip & 5432 without using jboss?
          did you set the tcp/ip option when starting postgres? (its off by default)
          are they on the same machine? (jboss & postgres)

          you can use this
          http://www.ems-hitech.com/pgmanager/
          to connect to postgres

          let me know...

          • 2. Re: JBoss-3.0.4 and postgres configuration
            darryl_staflund

            Hi there,

            I found that placing the 'postgresql.jar' and 'postgresql-service.xml' in the '/deploy' directory instead of the 'conf' directory worked. Give it a try.

            Darryl

            • 3. Re: JBoss-3.0.4 and postgres configuration
              wasihasi

              Look at this part in the example you copied:

              <!-- ===================================================================== -->
              <!--uncomment out this line if you are using the PostgresDbRealm above
              -->
              PostgresDbRealm

              The attribute is not uncommented by default. You have to do it, because you are using PostgresDbRealm.

              In the example you copied is also a configuration which should be put to login-config. It is in the large uncommented part at the top of the file. This configuration does not look like your policy in login-config. Try to remake it.

              hope this helps