Ashok Raman
Ashok Raman

Reputation: 31

In moqui, configuration to use mysql and loading with seed data

In moqui, I am trying to configure to use mysql, commented out derby and uncommented mysql in defaultconf, I copied the connector to framework lib, included the dependency in framework build.gradle, on running load, I get this error - java.lang.reflect.InvocationTargetExceptionjavax.management.InstanceAlreadyExistsException: bitronix.tm:type=JDBC,UniqueName=DEFAULT_transactional_DS,Id=0 -- thanks for any help

Upvotes: 2

Views: 875

Answers (2)

Swapnil M Mane
Swapnil M Mane

Reputation: 336

Can you post a snippet of code you have modified in MoquiDefaultConf.xml and build.graddle file.

A viable alternative to configure MySQL with Moqui is by doing related setting in configuration files (i.e. MoquiDevConf.xml for development instance, MoquiStagingConf.xml for staging instance and MoquiProductionConf.xml for production instance.). Follow the steps below to configure MySQL with Moqui.

  1. Since, May be you are trying to do some development, you need to make changes in MoquiDevConf.xml file only. Replace the <entity-facade> code in MoquiDevConf.xml with the following code.

<entity-facade crypt-pass="MoquiDefaultPassword:CHANGEME">
    <datasource group-name="transactional" database-conf-name="mysql" schema-name="">
        <inline-jdbc jdbc-uri="jdbc:mysql://127.0.0.1:3306/MoquiTransactional?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8"
                     jdbc-username="MYSQL_USER_NAME" jdbc-password="MYSQL_PASSWORD" pool-minsize="2" pool-maxsize="50"/>
    </datasource>
</entity-facade>
In the code above 'MoquiDEFAULT' is the name of database. Replace the MYSQL_USER_NAME and MYSQL_PASSWORD with your MySQL username and password.

  1. Create a database in MySQL (as per the code above, create the database with name MoquiTransactional).
  2. Add the jdbc driver for MySQL in the runtime/lib directory.
  3. In MoquiInit.properties file, set MoquiDevConf.xml file path to "moqui.conf" property i.e. moqui.conf=conf/MoquiDevConf.xml
  4. Now just simply build, load and run.

To answer your question for loading seed data,

you can simply the run the gradle command gradle load -Ptypes=seed, this only loads the seed type data.

Upvotes: 5

David E. Jones
David E. Jones

Reputation: 1776

Without more details my best guess is that you have another instance of Bitronix running on the machine, by the UniqueName almost certainly another instance of Moqui running. Make sure no other instance is running, killing background processes if there are any, before starting your new instance.

Upvotes: 0

Related Questions