Hello,
I am deploying the Jruby application with Postgresql database on Tomcat
6.0.32. Jruby version is 1.5.1(ruby 1.8.7 patchlevel 249). I have
unpacked the gems into the vendor/gems directory and also freezed the
rails into vendor/rails directory. Then I created the war file using
warble. The war file is copied into the tomcat webapps folder.
There was an initial error with the activerecord-jdbcpostgresql-adapter
gem when it is unpacked into the vendor/gems folder. The unpacked gem
folder name was activerecord-jdbcpostgresql-adapter-1.0.2-java. The
error was because of the string java attached at the end of the folder
name. After I did some google, found out that the string “-java” was
causing the error and renamed the folder name and removed the string
“-java”. Now I am getting connection refused error when I look into the
log file.
Here is the error log
31 Mar, 2011 4:07:01 PM org.apache.catalina.core.ApplicationContext log
INFO: /!\ FAILSAFE /!\ Thu Mar 31 16:07:01 +0530 2011
Status: 500 Internal Server Error
The driver encountered an unknown error:
org.postgresql.util.PSQLException: Connection refused. Check that the
hostname and port are correct and that the postmaster is accepting
TCP/IP connections.
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/gems/activerecord-jdbc-adapter-1.1.1/lib/arjdbc/jdbc/connection.rb:93:in
initialize' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/gems/activerecord-jdbc-adapter-1.1.1/lib/arjdbc/jdbc/adapter.rb:31:in
new’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/gems/activerecord-jdbc-adapter-1.1.1/lib/arjdbc/jdbc/adapter.rb:31:in
initialize' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/gems/activerecord-jdbc-adapter-1.1.1/lib/arjdbc/jdbc/connection_methods.rb:6:in
new’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/gems/activerecord-jdbc-adapter-1.1.1/lib/arjdbc/jdbc/connection_methods.rb:6:in
jdbc_connection' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/gems/activerecord-jdbc-adapter-1.1.1/lib/arjdbc/postgresql/connection_methods.rb:13:in
postgresql_connection’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
new_connection' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
checkout_new_connection’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
checkout' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
loop’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
checkout' file:/usr/local/tomcat/webapps/Control/WEB-INF/lib/jruby-stdlib-1.5.1.jar!/META-INF/jruby.home/lib/ruby/1.8/monitor.rb:191:in
mon_synchronize’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
checkout' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
connection’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
retrieve_connection' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in
retrieve_connection’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in
connection' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in
cache’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in
call' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
call’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in
call' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/gems/rack-1.1.0/lib/rack/head.rb:9:in
call’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in
call' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in
call’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:99:in
call' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in
call’
/usr/local/tomcat/webapps/Control/WEB-INF/vendor/gems/rack-1.1.0/lib/rack/lock.rb:11:in
call' /usr/local/tomcat/webapps/Control/WEB-INF/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in
call’
file:/usr/local/tomcat/webapps/Control/WEB-INF/lib/jruby-rack-1.0.2.jar!/rack/adapter/rails.rb:36:in
serve_rails' file:/usr/local/tomcat/webapps/Control/WEB-INF/lib/jruby-rack-1.0.2.jar!/rack/adapter/rails.rb:41:in
call’
file:/usr/local/tomcat/webapps/Control/WEB-INF/lib/jruby-rack-1.0.2.jar!/jruby/rack/rails.rb:180:in
call' file:/usr/local/tomcat/webapps/Control/WEB-INF/lib/jruby-rack-1.0.2.jar!/rack/handler/servlet.rb:19:in
call’
:2
I even checked the pg_conf.hba file and it has the below conf.
TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 192.168.0.0/24 password
Any help would be appreciated.
Regards,
Madhusudhan.