Search code examples
moqui

How to disable the OrientDb in Moqui


I am trying to run Moqui by dropping the war file into tomcat6, but it complains about OrientDb, which I don't need, so I would like to disable it.

I commented out the datasource reference in MoquiDefaultConf.xml but it still complains (SEVERE: Exception sending context initialized event to listener instance of class org.moqui.impl.webapp.MoquiContextListener java.io.FileNotFoundException: /var/lib/tomcat6/webapps/offernanny/runtime/db/orientdb/config/orientdb-server-config.xml (No such file or directory)).


Solution

  • To disable OrientDB you'll need to tell the Entity Facade to use a different datasource for the "nosql" entity group. Here is an example snippet for the runtime Moqui Conf XML file (i.e. MoquiDevConf.xml, MoquiProductionConf.xml, etc):

    <entity-facade crypt-pass="MoquiDefaultPassword:CHANGEME">
        <!-- add datasource elements here to configure databases -->
        <datasource group-name="nosql" database-conf-name="derby" schema-name="MOQUI" object-factory="">
            <inline-jdbc pool-minsize="2" pool-maxsize="20">
                <xa-properties databaseName="${moqui.runtime}/db/derby/MoquiTransactional" createDatabase="create"/>
            </inline-jdbc>
        </datasource>
    </entity-facade>
    

    This changes it to use the MoquiTransactional database, the same db as the "transactional" entity group.

    Additional information for the other part of your question: the reason the runtime/db/orientdb/config/orientdb-server-config.xml file was not found was because it was not there. The gradle addRuntime task and ant add-runtime target were not copying the runtime/db directory. This is changed in commit #d3eebaa on the master branch, and OrientDB runs under Tomcat now with an embedded runtime directory.