title: How to use SQL Server 2008 R2 as persistent storage for ActiveMQ 5.9
body: <p>My IT infrastructure requires persistence based on a SQL Server 2008 R2 database.</p>
  
  <p>I'm trying to configure SQL Server persistence for ActiveMQ 5.9 on windows, but can't figure out a correct configuration schema with or without journalling.</p>
  
  <p>The default configuration uses kahadb, and it works:</p>
  
  <pre><code>&lt;persistenceAdapter&gt;
      &lt;kahaDB directory="${activemq.data}/kahadb" /&gt;
  &lt;/persistenceAdapter&gt;
  </code></pre>
  
  <p>I'm using this documentation a reference to configure SQL Server persistence:
  <a href="http://activemq.apache.org/sqlserver.html" rel="nofollow">http://activemq.apache.org/sqlserver.html</a></p>
  
  <pre><code>&lt;persistenceAdapter&gt;
    &lt;journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data" dataSource="#mssql-ds"&gt;
      &lt;adapter&gt;&lt;imageBasedJDBCAdaptor/&gt;&lt;/adapter&gt;
    &lt;/journaledJDBC&gt;
  &lt;/persistenceAdapter&gt;
  
  &lt;bean id="mssql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
    &lt;property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/&gt;
    &lt;property name="url" value="jdbc:sqlserver://HOST:PORT;databaseName=DBNAME;user=USER;password=PASSWORD"/&gt;
    &lt;property name="username" value="USER"/&gt;
    &lt;property name="password" value="PASSWORD"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>This is the error in xml parser I get:</p>
  
  <blockquote>
    <p>ERROR | Failed to load: class path resource [activemq.xml], reason: Line 88 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 88; columnNumber: 95; cvc-complex-type.2.4.a: Invalid content was found starting with element 'journaledJDBC'. One of '{"<a href="http://activemq.apache.org/schema/core" rel="nofollow">http://activemq.apache.org/schema/core</a>":jdbcPersistenceAdapter, "<a href="http://activemq.apache.org/schema/core" rel="nofollow">http://activemq.apache.org/schema/core</a>":journalPersistenceAdapter, "<a href="http://activemq.apache.org/schema/core" rel="nofollow">http://activemq.apache.org/schema/core</a>":kahaDB, "<a href="http://activemq.apache.org/schema/core" rel="nofollow">http://activemq.apache.org/schema/core</a>":levelDB, "<a href="http://activemq.apache.org/schema/core" rel="nofollow">http://activemq.apache.org/schema/core</a>":mKahaDB, "<a href="http://activemq.apache.org/schema/core" rel="nofollow">http://activemq.apache.org/schema/core</a>":memoryPersistenceAdapter, "<a href="http://activemq.apache.org/schema/core" rel="nofollow">http://activemq.apache.org/schema/core</a>":replicatedLevelDB, WC[##other:"<a href="http://activemq.apache.org/schema/core" rel="nofollow">http://activemq.apache.org/schema/core</a>"]}' is expected.</p>
  </blockquote>
  
  <p>Please help me to figure out the configuration schema for SQL Server persistence, or provide a documentation link specific to version ActiveMQ 5.9</p>