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
-
Would you add the entity-facade.datasource elements from your Moqui Conf Xml file? That would help to see exactly what you are doing. – David E. Jones Oct 02 '14 at 15:12
-
BTW, you can add the JDBC driver JAR file to the runtime/lib directory (or in the lib directory in any component), no need (or reason) to put it in framework/lib or include it in the build.gradle file. – David E. Jones Oct 02 '14 at 15:15
2 Answers
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.
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&useUnicode=true&characterEncoding=UTF-8"
jdbc-username="MYSQL_USER_NAME" jdbc-password="MYSQL_PASSWORD" pool-minsize="2" pool-maxsize="50"/>
</datasource>
</entity-facade>
- Create a database in MySQL (as per the code above, create the database with name MoquiTransactional).
- Add the jdbc driver for MySQL in the runtime/lib directory.
- In MoquiInit.properties file, set MoquiDevConf.xml file path to "moqui.conf" property i.e. moqui.conf=conf/MoquiDevConf.xml
- 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.

- 394
- 1
- 10
-
Thanks Swapnil. Please note that this is an older configuration pattern, in more recent versions of Moqui the DB name "MoquiDEFAULT" is the one in the example, and it is only necessary to have a datasource element for group-name=transactional (the others will default to this one for when you don't need/want separate databases). Note that you also need a tenantcommon datasource element if you are using multiple tenants. This information is in the Making Apps for Moqui book. – David E. Jones Oct 02 '14 at 20:24
-
Thanks David E. for the update, I have updated the answer as per the newer database configuration pattern. – Swapnil M Mane Oct 03 '14 at 09:45
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.

- 1,721
- 1
- 9
- 8
-
Thanks, these suggestions helped, I stopped a few services (just in case), re-extracted 1.4.1, setup MoquiDevConf as above and am up running. This is a much cleaner approach. – Ashok Raman Oct 04 '14 at 16:04