6 Replies Latest reply on Aug 12, 2003 9:36 AM by ferakiii

    PostgreSQL Configuration Under Cygwin

    ferakiii Newbie

      I'm trying to connect a DataSource through to a PostgreSQL 7.3 database running under Cygwin on my local Windows XP machine. The PostgreSQL database runs fine, and I can create a JDBC connection, but I can't seem to get JBoss to bind a DataSource. I have added a postgres-service.xml file to my deploy directory, which binds two different datasources. In the log files it says something about the names being bound:

      2003-08-08 17:57:57,436 DEBUG [org.jboss.system.ServiceConfigurator] JndiName set to SafetyDS in jboss.jca:service=LocalTxDS,name=SafetyDS

      but then later on it throws this error:

      2003-08-08 17:58:13,229 ERROR [org.jboss.ejb.EjbModule] Initialization failed
      org.jboss.deployment.DeploymentException: Error: can't find data source: java:/SafetyDS; - nested throwable: (javax.naming.NameNotFoundException: SafetyDS not bound)

      saying that the datasource is not bound.

      I'm a newbie at JBoss, and I have spent a week trying to figure out what is going on. Does anyone have any ideas?

      Cheers

      Paul

        • 1. Re: PostgreSQL Configuration Under Cygwin
          Jon Barnett Master

          What is your version of JBoss? And if you could post your datasource configuration that would help. If you are using a 3.2.x release, you'll want the postgres-ds.xml template from docs/examples/jca.

          • 2. Re: PostgreSQL Configuration Under Cygwin
            ferakiii Newbie

            I am using JBoss 3.0.0 with Tomcat intergration.

            Attached should be the data source config files.

            Thanks for your interest.

            Cheers

            Paul

            • 3. Re: PostgreSQL Configuration Under Cygwin
              Jon Barnett Master

              OK. 3.0.x is a fair time ago but here is a working configuration from 3.0.6. I've set the security realm in login-config.xml and this ties to the postgres-service.xml. Note the match-up of the username/password.

              The following server log shows a successful binding of the connection pool/DataSource.

              2003-06-20 21:13:28,716 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Added PostgresDbRealm, org.jboss.security.plugins.SecurityDomainContext@10d9151 to map
              2003-06-20 21:13:28,726 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.AmityPool] Bound connection factory for resource adapter 'JBoss LocalTransaction JDBC Wrapper' to JNDI name 'java:/AmityPool'
              2003-06-20 21:13:28,726 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager] Started
              2003-06-20 21:13:28,726 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Java/jboss-3.0.6/server/default/deploy/jboss-local-jdbc.rar
              2003-06-20 21:13:28,746 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Java/jboss-3.0.6/server/default/deploy/jboss-xa.rar
              2003-06-20 21:13:28,807 INFO [org.jboss.resource.RARMetaData] Loading Minerva Resource Adapter for JDBC 2 XA drivers
              2003-06-20 21:13:28,807 INFO [org.jboss.resource.RARMetaData] Required license terms present. See deployment descriptor.

              I was actually using this against a Cygwin-based Postgres installation.

              Make sure that your JDBC driver is in server/instance/lib. Normally, it is called pg73jdbc3.jar for the Postgresql 2.3.x series.

              • 4. Re: PostgreSQL Configuration Under Cygwin
                ferakiii Newbie

                Thanks for the sample files, I can't imediately spot anything different in them from mine, but I've only had a 5 second look, and it is 4 in the morning.

                I'll try upgrading to JBoss 3.0.8 and see if that helps.

                I noticed that your output has Bound connection factory for your datasource, I searched my log files for this and only found the default datasource binding. My configured datasource, only gave this output:

                2003-08-08 17:57:57,336 DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.jca:service=LocalTxCM,name=SafetyDS
                2003-08-08 17:57:57,336 DEBUG [org.jboss.system.ServiceCreator] code: org.jboss.resource.connectionmanager.LocalTxConnectionManager
                2003-08-08 17:57:57,346 DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.jca:service=LocalTxCM,name=SafetyDS
                2003-08-08 17:57:57,396 DEBUG [org.jboss.system.ServiceConfigurator] SecurityDomainJndiName set to DSSafetySecurity in jboss.jca:service=LocalTxCM,name=SafetyDS
                2003-08-08 17:57:57,396 DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.jca:service=LocalTxDS,name=SafetyDS
                2003-08-08 17:57:57,396 DEBUG [org.jboss.system.ServiceCreator] code: org.jboss.resource.connectionmanager.RARDeployment
                2003-08-08 17:57:57,396 DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.jca:service=LocalTxDS,name=SafetyDS
                2003-08-08 17:57:57,436 DEBUG [org.jboss.system.ServiceConfigurator] JndiName set to SafetyDS in jboss.jca:service=LocalTxDS,name=SafetyDS
                2003-08-08 17:57:57,436 DEBUG [org.jboss.system.ServiceConfigurator] ManagedConnectionFactoryProperties set to
                <config-property name="ConnectionURL" type="java.lang.String">jdbc:postgresql://localhost:5432/Safety01</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">Paul</config-property>
                <config-property name="Password" type="java.lang.String" />
                in jboss.jca:service=LocalTxDS,name=SafetyDS
                2003-08-08 17:57:57,436 DEBUG [org.jboss.system.ServiceController] recording that jboss.jca:service=LocalTxDS,name=SafetyDS depends on jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
                2003-08-08 17:57:57,436 DEBUG [org.jboss.system.ServiceConfigurator] considering OldRarDeployment with object name jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
                2003-08-08 17:57:57,436 DEBUG [org.jboss.system.ServiceController] recording that jboss.jca:service=LocalTxCM,name=SafetyDS depends on jboss.jca:service=LocalTxDS,name=SafetyDS
                2003-08-08 17:57:57,436 DEBUG [org.jboss.system.ServiceConfigurator] considering ManagedConnectionFactoryName with object name jboss.jca:service=LocalTxDS,name=SafetyDS


                Thanks heaps for the help

                Cheers

                Paul

                • 5. Re: PostgreSQL Configuration Under Cygwin
                  Jon Barnett Master

                  I don't think you have defined the default connection password. That is the only major difference I've spotted from your log. It may be possible for your error to occur if you are not passing an explicit username/password when requesting a datasource connection in your code.

                  • 6. Re: PostgreSQL Configuration Under Cygwin
                    ferakiii Newbie

                    Thanks heaps. I think I have found it.

                    It is either the default password thingy (I was using a user that had no password, but this may have been the problem). I also upgraded to JBoss 3.0.8 at the same time, so this may have also helped things, but I no longer get any datasource related errors. I have other problems now, but that one seems to be fixed.

                    Thanks heaps for the help

                    Cheers

                    Paul