title: Avoid WildFly's artemis automatic table creation when journal-datasource is configured
body: <p>I'm using WildFly 11 and I've configured it to persist the messages into the database but I've already created the tables and when the server is starting it gives this error:</p>
  <pre><code>10:50:06,787 ERROR [org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver] (ServerService Thread Pool -- 74)
  SQL STATEMENTS:
  CREATE TABLE PAGE_STORE (ID BIGSERIAL, FILENAME VARCHAR(255), EXTENSION VARCHAR(10), DATA BYTEA, PRIMARY KEY(ID))
  SQL EXCEPTIONS:
  SQLState: 42P07 ErrorCode: 0 Message: ERROR: relation &quot;page_store&quot; already exists
  10:50:06,950 WARN  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 74) AMQ222010: Critical IO Error, shutting down the server. file=NULL, message=Unable to start database driver: org.postgresql.util.PSQLException: ERROR: relation &quot;page_store&quot; already exists
          at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
          at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
          at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
          at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
          at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
          at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
          at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
          at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
          at org.postgresql.jdbc.PgStatement.executeUpdate(PgStatement.java:244)
          at org.jboss.jca.adapters.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:430)
          at org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver.createTableIfNotExists(AbstractJDBCDriver.java:194) [artemis-jdbc-store-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver.createTable(AbstractJDBCDriver.java:112) [artemis-jdbc-store-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFileFactoryDriver.createSchema(JDBCSequentialFileFactoryDriver.java:69) [artemis-jdbc-store-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver.start(AbstractJDBCDriver.java:82) [artemis-jdbc-store-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFileFactory.start(JDBCSequentialFileFactory.java:127) [artemis-jdbc-store-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.core.paging.impl.PagingStoreFactoryDatabase.start(PagingStoreFactoryDatabase.java:124) [artemis-server-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.core.paging.impl.PagingStoreFactoryDatabase.&lt;init&gt;(PagingStoreFactoryDatabase.java:100) [artemis-server-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.getPagingStoreFactory(ActiveMQServerImpl.java:1854) [artemis-server-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createPagingManager(ActiveMQServerImpl.java:1848) [artemis-server-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart1(ActiveMQServerImpl.java:2015) [artemis-server-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:62) [artemis-server-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:518) [artemis-server-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:466) [artemis-server-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:413) [artemis-jms-server-1.5.5.jbossorg-008.jar:1.5.5.jbossorg-008]
          at org.wildfly.extension.messaging.activemq.jms.JMSService.doStart(JMSService.java:205) [wildfly-messaging-activemq-11.0.0.Final.jar:11.0.0.Final]
          at org.wildfly.extension.messaging.activemq.jms.JMSService.access$000(JMSService.java:64) [wildfly-messaging-activemq-11.0.0.Final.jar:11.0.0.Final]
          at org.wildfly.extension.messaging.activemq.jms.JMSService$1.run(JMSService.java:99) [wildfly-messaging-activemq-11.0.0.Final.jar:11.0.0.Final]
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_241]
          at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_241]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_241]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_241]
          at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_241]
          at org.jboss.threads.JBossThread.run(JBossThread.java:320) [jboss-threads-2.2.1.Final.jar:2.2.1.Final]
  </code></pre>
  <p>This is the activemq server:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;subsystem xmlns=&quot;urn:jboss:domain:messaging-activemq:2.0&quot;&gt;
      &lt;server name=&quot;default&quot;&gt;
          &lt;journal datasource=&quot;PostgresLocalDS&quot;/&gt;
          &lt;security-setting name=&quot;#&quot;&gt;
              &lt;role name=&quot;guest&quot; send=&quot;true&quot; consume=&quot;true&quot; create-non-durable-queue=&quot;true&quot; delete-non-durable-queue=&quot;true&quot;/&gt;
          &lt;/security-setting&gt;
          &lt;address-setting name=&quot;#&quot; dead-letter-address=&quot;jms.queue.DLQ&quot; expiry-address=&quot;jms.queue.ExpiryQueue&quot; max-size-bytes=&quot;10485760&quot; page-size-bytes=&quot;2097152&quot; message-counter-history-day-limit=&quot;10&quot;/&gt;
          &lt;http-connector name=&quot;http-connector&quot; socket-binding=&quot;http&quot; endpoint=&quot;http-acceptor&quot;/&gt;
          &lt;http-connector name=&quot;http-connector-throughput&quot; socket-binding=&quot;http&quot; endpoint=&quot;http-acceptor-throughput&quot;&gt;
              &lt;param name=&quot;batch-delay&quot; value=&quot;50&quot;/&gt;
          &lt;/http-connector&gt;
          &lt;in-vm-connector name=&quot;in-vm&quot; server-id=&quot;0&quot;/&gt;
          &lt;http-acceptor name=&quot;http-acceptor&quot; http-listener=&quot;default&quot;/&gt;
          &lt;http-acceptor name=&quot;http-acceptor-throughput&quot; http-listener=&quot;default&quot;&gt;
              &lt;param name=&quot;batch-delay&quot; value=&quot;50&quot;/&gt;
              &lt;param name=&quot;direct-deliver&quot; value=&quot;false&quot;/&gt;
          &lt;/http-acceptor&gt;
          &lt;in-vm-acceptor name=&quot;in-vm&quot; server-id=&quot;0&quot;/&gt;
          &lt;jms-queue name=&quot;ExpiryQueue&quot; entries=&quot;java:/jms/queue/ExpiryQueue&quot;/&gt;
          &lt;jms-queue name=&quot;DLQ&quot; entries=&quot;java:/jms/queue/DLQ&quot;/&gt;
          &lt;connection-factory name=&quot;InVmConnectionFactory&quot; entries=&quot;java:/ConnectionFactory&quot; connectors=&quot;in-vm&quot;/&gt;
          &lt;connection-factory name=&quot;RemoteConnectionFactory&quot; connectors=&quot;http-connector&quot; entries=&quot;java:jboss/exported/jms/RemoteConnectionFactory&quot;/&gt;
          &lt;pooled-connection-factory name=&quot;activemq-ra&quot; entries=&quot;java:/JmsXA java:jboss/DefaultJMSConnectionFactory&quot; connectors=&quot;in-vm&quot; transaction=&quot;xa&quot;/&gt;
      &lt;/server&gt;
  &lt;/subsystem&gt;
  </code></pre>
  <p>And I read the <a href="https://wildscribe.github.io/WildFly/11.0/subsystem/messaging-activemq/server/index.html" rel="nofollow noreferrer">model reference about the ActiveMQ subsystem</a> and I didn't find any property that disables the automatic creation of the journal's table.</p>
  <p>Remove the SQL template or delete the file's content from <code>$JBOSS_HOME/modules/system/layers/base/org/wildfly/extension/messaging-activemq/main/database/journal-sql.properties</code> it doesn't work.</p>
  <p>So is there a way to disable the automatic creation?</p>