How to add PostgreSQL datasource to WildFly 9.0?

后端 未结 6 1496
刺人心
刺人心 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:56

    I am running wildfly 10 in a docker:

    #ADD DATASOURCES
    RUN mkdir -p $JBOSS_HOME/modules/org/postgres/main
    COPY files/postgresql-9.4.1208.jre7.jar $JBOSS_HOME/modules/org/postgres/main/
    COPY files/module.xml $JBOSS_HOME/modules/org/postgres/main/
    COPY files/standalone.xml $JBOSS_HOME/standalone/configuration
    

    Where module.xml is

    
        
            
        
        
            
            
            
        
    
    

    And standalone contains driver:

    
        org.postgresql.Driver
    
    

    then datasource can be:

    
        jdbc:postgresql://ndis-db:5432/postgres
            postgresql
            ...
    

    Note that my ndis-db is a postgres docker. In your case can be localhost.

    How I ended up with the error mentioned by you: 1. file name spelled wrongly 2. /modules/org ...etc contain a typo 3. module.xml misspelled as modules.xml 4. ...

提交回复
热议问题