Search code examples
postgresqlsymmetricds

Postgres not working for symmetric ds durring symtable command


I am trying to connect postgres db to symmetric ds.
so i created a properties file named local-001.properties ,which i then placed in engines folder after which i am trying to run ./sym start command.
but i am getting following error :

java.sql.SQLException: Cannot create PoolableConnectionFactory ([Amazon][JDBC](11380) Null pointer exception.)
    at org.jumpmind.db.util.ResettableBasicDataSource.createPoolableConnectionFactory(ResettableBasicDataSource.java:78)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
    at org.jumpmind.symmetric.ClientSymmetricEngine.waitForAvailableDatabase(ClientSymmetricEngine.java:467)
    at org.jumpmind.symmetric.ClientSymmetricEngine.createDatabasePlatform(ClientSymmetricEngine.java:385)
    at org.jumpmind.symmetric.ClientSymmetricEngine.createDatabasePlatform(ClientSymmetricEngine.java:335)
    at org.jumpmind.symmetric.ClientSymmetricEngine.createDatabasePlatform(ClientSymmetricEngine.java:328)
    at org.jumpmind.symmetric.AbstractSymmetricEngine.init(AbstractSymmetricEngine.java:316)
    at org.jumpmind.symmetric.ClientSymmetricEngine.init(ClientSymmetricEngine.java:203)
    at org.jumpmind.symmetric.web.ServerSymmetricEngine.init(ServerSymmetricEngine.java:80)
    at org.jumpmind.symmetric.ClientSymmetricEngine.<init>(ClientSymmetricEngine.java:159)
    at org.jumpmind.symmetric.web.ServerSymmetricEngine.<init>(ServerSymmetricEngine.java:59)
    at org.jumpmind.symmetric.web.SymmetricEngineHolder.create(SymmetricEngineHolder.java:285)
    at org.jumpmind.symmetric.web.SymmetricEngineHolder$EngineStarter.run(SymmetricEngineHolder.java:597)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.sql.SQLException: [Amazon][JDBC](11380) Null pointer exception.
    at com.amazon.redshift.client.PGClient.startSession(Unknown Source)
    at com.amazon.redshift.client.PGClient.<init>(Unknown Source)
    at com.amazon.redshift.core.PGJDBCConnection.connect(Unknown Source)
    at com.amazon.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
    at com.amazon.jdbc.common.AbstractDriver.connect(Unknown Source)
    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
    at org.jumpmind.db.util.ResettableBasicDataSource.createPoolableConnectionFactory(ResettableBasicDataSource.java:72)


My properties file is as below :


engine.name=local-001
group.id=local
external.id=001
sync.url=http://localhost:31415/sync/local-001
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/samplelocal
db.user=user
db.password=password

Solution

  • Edit: I had the same issues with symmetricDS 3.11.6 and I changed it to 3.8.43 and it worked smoothly. By 3.8.43, I chose it randomly. So you don't have to stick with that specific version but definitely worth trying another version, especially an old version.

    God how much time I wasted on this issue....


    Original

    Try this:

    db.url=jdbc:postgresql:samplelocal
    

    https://jdbc.postgresql.org/documentation/80/connect.html

    But in case you'd like to specify your custom port, say 5433, you have no choice but to use the format like you did. (db.url=jdbc:postgresql://localhost:5433/samplelocal). And I couldn't find out how to make it work.