How to add PostgreSQL datasource to WildFly 9.0?

后端 未结 6 1500
刺人心
刺人心 2020-12-03 15:23

I\'ve tried tutorial at mastertheboss.com:

  1. ./jboss-cli.sh
  2. module add --name=org.postgres --resources=/tmp/postgresql-9.3-1101.jdbc4
6条回答
  •  悲哀的现实
    2020-12-03 15:59

    You don't mention your java/jdbc version. I've just experienced the same issue and it was due to a driver vs Java 1.8 mismatch. With the wildfly 9 upgrade did you also upgrade Java?

    The ".jdbc41." driver version is built for Java 1.7. Postgres has a matrix showing the combinations of Java/JDBC and Postgres driver versions that are compatible. Perhaps you need: postgresql-9.4.1209.jar (which is for 1.8/jdbc42)

    Then in the CLI (assuming domain mode and profile=full)

    module add --name=org.postgresql.Driver --resources=/tmp/postgresql-9.4.1209.jar
    connect
    /profile=full/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgresql.Driver",driver-class-name=org.postgresql.Driver)
    exit
    

提交回复
热议问题