Re: Postgresql connection issue
Re: Postgresql connection issue
- Subject: Re: Postgresql connection issue
- From: Ramsey Gurley <email@hidden>
- Date: Tue, 12 Nov 2013 15:35:07 -0700
For what it’s worth, I needed my local machine in the file under its 192.168.x.x address for everything to work. May be because the database is dedicated? Don’t know. Here’s what I have though:
postgresql.conf
listen_addresses = 'localhost,192.168.100.96’
pg_hba.conf
host all all 192.168.100.96/32 md5
On Nov 12, 2013, at 3:23 PM, Joe Kramer <email@hidden> wrote:
> The DB is on the same machine, so not sure why I would need another host entry.
>
> Sent from my iPhone
>
> On Nov 12, 2013, at 1:50 PM, Theodore Petrosky <email@hidden> wrote:
>
>> btw, did you read this in the pg_hba.conf file:
>>
>> #
>> # If you want to allow non-local connections, you need to add more
>> # "host" records. In that case you will also need to make PostgreSQL
>> # listen on a non-local interface via the listen_addresses
>> # configuration parameter, or via the -i or -h command line switches.
>>
>> # CAUTION: Configuring the system for local "trust" authentication
>> # allows any local user to connect as any PostgreSQL user, including
>> # the database superuser. If you do not trust all your local users,
>> # use another authentication method.
>>
>> and from postgresql.conf
>>
>> #------------------------------------------------------------------------------
>> # CONNECTIONS AND AUTHENTICATION
>> #------------------------------------------------------------------------------
>>
>> # - Connection Settings -
>>
>> listen_addresses = '*' # what IP address(es) to listen on;
>> # comma-separated list of addresses;
>> # defaults to 'localhost'; use '*' for all
>> # (change requires restart)
>>
>>
>>
>>
>> On Nov 12, 2013, at 4:19 PM, Ramsey Gurley <email@hidden> wrote:
>>
>>> Is the db on the same machine as the app? If not, this won’t work. You need to add the IP of your app server. Something like...
>>>
>>> host all all 192.168.0.100 trust
>>>
>>>
>>> On Nov 12, 2013, at 1:41 PM, Joe Kramer <email@hidden> wrote:
>>>
>>>> Thanks for the reply. Here is my config in pg_hba.conf. It seems like this should not be causing the issue. Any other thoughts or something I am missing in this config?
>>>>
>>>> Thanks,
>>>>
>>>> Joe
>>>>
>>>> # TYPE DATABASE USER ADDRESS METHOD
>>>>
>>>> # "local" is for Unix domain socket connections only
>>>> local all all trust
>>>> # IPv4 local connections:
>>>> host all all 127.0.0.1/32 trust
>>>> # IPv6 local connections:
>>>> host all all ::1/128 trust
>>>>
>>>>
>>>> On Tue, Nov 12, 2013 at 2:36 AM, Þór Sigurðsson <email@hidden> wrote:
>>>>
>>>> Have you given the user permission to connect to the database ?
>>>>
>>>> Take a look at pg_hba.conf. Add a line for the user. If you _want_ the user to use a password, then the last column should be "password" or better yet "md5". If you want a trust-level connection, set it to "trust".
>>>>
>>>> On 12.11.2013, at 09:58, Joe Kramer <email@hidden> wrote:
>>>>
>>>> > Hi all,
>>>> >
>>>> > It has been some time since I have done any WebObjects development and I am trying to resurrect an old project on a new machine. I went through all the steps to get WebObjects/Wonder installed and I can run HelloWorld. The problem appears to be with my Postgresql JDBC connection. I am running Postgres93.app. I added the postgresql-9.3-1100.jdbc3.jar to my project's Resources folder and added that jar to the build path. When I run and try to bootstrap my database, I cannot connect and I get the following error. Is there something that I missed in the setup process? Any help would be appreciated.
>>>> >
>>>> > Thanks,
>>>> >
>>>> > Joe Kramer
>>>> >
>>>> > Nov 12 01:49:37 GALApplication[9199] WARN NSLog - An exception occurred while trying to open a channel: N/A
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.Exceptions - Database Exception occured: java.lang.IllegalStateException: _obtainOpenChannel -- com.webobjects.eoaccess.EODatabaseContext com.webobjects.eoaccess.EODatabaseContext@105585dc: failed to open database channel. Check your connection dictionary, and ensure your database is correctly configured.
>>>> > Nov 12 01:49:37 GALApplication[9199] DEBUG NSLog - Using JDBCPlugIn 'PostgresqlPlugIn' for JDBCAdaptor@1767199109
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.extensions.eof.ERXDatabaseContextDelegate - GALDatabase: {plugin = "PostgresqlPlugIn"; username = "jkramer"; driver = "org.postgresql.Driver"; password = "<password deleted for log>"; URL = "jdbc:postgresql://localhost/gal_database?useBundledJdbcInfo=true"; }
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.ConnectionAnalyzer - Checking JDBC connection with information {plugin = "PostgresqlPlugIn"; username = "jkramer"; driver = "org.postgresql.Driver"; password = "<password deleted for log>"; URL = "jdbc:postgresql://localhost/gal_database?useBundledJdbcInfo=true"; }
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.ConnectionAnalyzer - Trying to create JDBCAdaptor...
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.ConnectionAnalyzer - Successfully created adaptor com.webobjects.jdbcadaptor.JDBCAdaptor
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.ConnectionAnalyzer - Trying to create plugin...
>>>> > Nov 12 01:49:37 GALApplication[9199] DEBUG NSLog - Using JDBCPlugIn 'PostgresqlPlugIn' for JDBCAdaptor@1616586953
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.ConnectionAnalyzer - Created plugin com.webobjects.jdbcadaptor.PostgresqlPlugIn
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.ConnectionAnalyzer - Trying to load JDBC driver org.postgresql.Driver...
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.ConnectionAnalyzer - Successfully loaded JDBC driver org.postgresql.Driver
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.ConnectionAnalyzer - JDBC driver and plugin are loaded, trying to connect...
>>>> > Nov 12 01:49:37 GALApplication[9199] INFO er.transaction.adaptor.ConnectionAnalyzer - Error: Exception thrown while connecting.
>>>> > Check exception message carefully.
>>>> > Nov 12 01:49:37 GALApplication[9199] ERROR er.transaction.adaptor.ConnectionAnalyzer - No connection.
>>>> > Nov 12 01:49:37 GALApplication[9199] WARN NSLog - A fatal exception occurred: _obtainOpenChannel -- com.webobjects.eoaccess.EODatabaseContext com.webobjects.eoaccess.EODatabaseContext@105585dc: failed to open database channel. Check your connection dictionary, and ensure your database is correctly configured.
>>>> > [2013-11-12 1:49:37 PST] <main> java.lang.IllegalStateException: _obtainOpenChannel -- com.webobjects.eoaccess.EODatabaseContext com.webobjects.eoaccess.EODatabaseContext@105585dc: failed to open database channel. Check your connection dictionary, and ensure your database is correctly configured.
>>>> > at com.webobjects.eoaccess.EODatabaseContext._obtainOpenChannel(EODatabaseContext.java:1967)
>>>> > at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3054)
>>>> > at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
>>>> > at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
>>>> > at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
>>>> > at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1308)
>>>> > at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4444)
>>>> > at er.extensions.eof.ERXFetchSpecification.fetchObjects(ERXFetchSpecification.java:155)
>>>> > at org.luth.eo._Product.fetchProducts(_Product.java:207)
>>>> > at org.luth.eo._Product.fetchAllProducts(_Product.java:201)
>>>> > at org.luth.eo._Product.fetchAllProducts(_Product.java:197)
>>>> > at org.luth.Application.migrateDbaseDB(Application.java:72)
>>>> > at org.luth.Application.<init>(Application.java:65)
>>>> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>>> > at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>>> > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>>> > at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>>> > at java.lang.Class.newInstance0(Class.java:357)
>>>> > at java.lang.Class.newInstance(Class.java:310)
>>>> > at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
>>>> > at er.extensions.appserver.ERXApplication.main(ERXApplication.java:861)
>>>> > at org.luth.Application.main(Application.java:58)
>>>> > _______________________________________________
>>>> > Do not post admin requests to the list. They will be ignored.
>>>> > Webobjects-dev mailing list (email@hidden)
>>>> > Help/Unsubscribe/Update your Subscription:
>>>> >
>>>> > This email sent to email@hidden
>>>>
>>>>
>>>> ________________________________
>>>>
>>>> Fyrirvari á tölvupósti / e-mail disclaimer
>>>> http://samgongustofa.is/fyrirvari/
>>>>
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list (email@hidden)
>>>> Help/Unsubscribe/Update your Subscription:
>>>>
>>>> This email sent to email@hidden
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden