immutant

http://immutant.org Note: dev discussion happens in #immutant on FreeNode IRC.
edvorg 2016-05-09T06:21:46.000210Z

Hello. We have a project that is using immutant war facilities. We deploy it under wildfly and just stepped into strange problem on production. We use component and postgresql. After redeploy in wildfly (using rm *.deployed, touch *.dodeploy) we have following exception when trying to use postgesql

le_results.clj:   98
12:30:41,471 INFO  [stdout] (pool-14-thread-4)                                                                                 ...            
12:30:41,471 INFO  [stdout] (pool-14-thread-4)                                                             clojure.java.jdbc/query                  jdbc.clj:  832
12:30:41,471 INFO  [stdout] (pool-14-thread-4)                                           clojure.java.jdbc/db-query-with-resultset                  jdbc.clj:  798
12:30:41,471 INFO  [stdout] (pool-14-thread-4)                                                    clojure.java.jdbc/get-connection                  jdbc.clj:  278
12:30:41,471 INFO  [stdout] (pool-14-thread-4)                               org.apache.commons.dbcp.BasicDataSource.getConnection      BasicDataSource.java: 1044
12:30:41,471 INFO  [stdout] (pool-14-thread-4)                            org.apache.commons.dbcp.BasicDataSource.createDataSource      BasicDataSource.java: 1371
12:30:41,471 INFO  [stdout] (pool-14-thread-4)                     org.apache.commons.dbcp.BasicDataSource.createConnectionFactory      BasicDataSource.java: 1437
12:30:41,471 INFO  [stdout] (pool-14-thread-4)                                                    java.sql.DriverManager.getDriver        DriverManager.java:  315
12:30:41,471 INFO  [stdout] (pool-14-thread-4)                      java.sql.SQLException: No suitable driver
12:30:41,471 INFO  [stdout] (pool-14-thread-4)      SQLState: "08001"
12:30:41,471 INFO  [stdout] (pool-14-thread-4)     errorCode: 0
12:30:41,471 INFO  [stdout] (pool-14-thread-4) org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.postgresql.
Driver' for connect URL 'jdbc:<postgresql://localhost/project?user=postgres&amp;password=postgres>'
12:30:41,471 INFO  [stdout] (pool-14-thread-4)     errorCode: 0
12:30:41,471 INFO  [stdout] (pool-14-thread-4)
12
Did anybody meet similar problem?

edvorg 2016-05-09T07:27:12.000215Z

The issue is probably related to the fact that our app doesn't get shutdown gracefully. We even don't have a chance to stop our component system. Maybe there is some hook that we could use to do our app shutdown?

2016-05-09T11:26:33.000216Z

@edvorg: you can register a shutdown hook with http://immutant.org/documentation/current/apidoc/immutant.util.html#var-at-exit - see if that helps

edvorg 2016-05-09T11:28:51.000217Z

Ok, thank you @tcrawley

2016-05-09T11:29:16.000218Z

my pleasure!