cannot create JDBC datasource named transactional_DS while implementing Multi-instance in moqui using docker

1.1k views Asked by At

As Multi-Tenant Functionality for Moqui Framework 2.0.0 has been removed, I am trying to implement same with Docker.

  1. I just created image using- $ ./docker-build.sh
  2. Modified- moqui-ng-my-compose.yml
  3. ./compose-run.sh moqui-ng-my-compose.yml
  4. Exception occurred: | 08:07:47.864 INFO main .moqui.i.c.TransactionInternalBitronix Initializing DataSource transactional_DS (mysql) with properties: [uri:jdbc:mysql://127.0.0.1:3306/moquitest_20161126?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8, user:root] moqui-server | 08:07:51.868 ERROR main o.moqui.i.w.MoquiContextListener Error initializing webapp context: bitronix.tm.resource.ResourceConfigurationException: cannot create JDBC datasource named transactional_DS moqui-server | bitronix.tm.resource.ResourceConfigurationException: cannot create JDBC datasource named transactional_DS moqui-server | at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:91) ~[btm-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT] moqui-server | at org.moqui.impl.context.TransactionInternalBitronix.getDataSource(TransactionInternalBitronix.groovy:129) ~[moqui-framework-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] moqui-server | at org.moqui.impl.entity.EntityDatasourceFactoryImpl.init(EntityDatasourceFactoryImpl.groovy:84) ~[moqui-framework-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] moqui-server | at org.moqui.impl.entity.EntityFacadeImpl.initAllDatasources(EntityFacadeImpl.groovy:193) ~[moqui-framework-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] moqui-server | at org.moqui.impl.entity.EntityFacadeImpl.<init>(EntityFacadeImpl.groovy:120) ~[moqui-framework-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] moqui-server | at org.moqui.impl.context.ExecutionContextFactoryImpl.<init>(ExecutionContextFactoryImpl.groovy:198) ~[moqui-framework-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]

Here is my moqui-ng-my-compose.yml file-

version: "2"
services:
  nginx-proxy:
    # For documentation on SSL and other settings see:
    # https://github.com/jwilder/nginx-proxy
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    restart: unless-stopped
    ports:
      - 80:80
      # - 443:443
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      # - /path/to/certs:/etc/nginx/certs
  moqui-server:
    image: moqui
    container_name: moqui-server
    command: conf=conf/MoquiDevConf.xml
    restart: unless-stopped
    links:
     - mysql-moqui
    volumes:
     - ./runtime/conf:/opt/moqui/runtime/conf
     - ./runtime/lib:/opt/moqui/runtime/lib
     - ./runtime/classes:/opt/moqui/runtime/classes
     - ./runtime/ecomponent:/opt/moqui/runtime/ecomponent
     - ./runtime/log:/opt/moqui/runtime/log
     - ./runtime/txlog:/opt/moqui/runtime/txlog
     # this one isn't needed: - ./runtime/db:/opt/moqui/runtime/db
     - ./runtime/elasticsearch:/opt/moqui/runtime/elasticsearch
    environment:
     - entity_ds_db_conf=mysql
     - entity_ds_host=localhost
     - entity_ds_port=3306
     - entity_ds_database=moquitest_20161126
     - entity_ds_user=root
     - entity_ds_password=123456
     # CHANGE ME - note that VIRTUAL_HOST is for nginx-proxy so it picks up this container as one it should reverse proxy
     - VIRTUAL_HOST=app.visvendra.hyd.company.com
     - webapp_http_host=app.visvendra.hyd.company.com
     - webapp_http_port=80
     # - webapp_https_port=443
     # - webapp_https_enabled=true

  mysql-moqui:
    image: mysql:5.7
    container_name: mysql-moqui
    restart: unless-stopped
    # uncomment this to expose the port for use outside other containers
    # ports:
    #  - 3306:3306
    # edit these as needed to map configuration and data storage
    volumes:
     - ./db/mysql/data:/var/lib/mysql
     # - /my/mysql/conf.d:/etc/mysql/conf.d
    environment:
     - MYSQL_ROOT_PASSWORD=123456
     - MYSQL_DATABASE=moquitest_20161126
     - MYSQL_USER=root
     - MYSQL_PASSWORD=123456

Please let me know if any other information required.

Thanks in advance!!

0

There are 0 answers