I found a solution to my problem. Had to update the xsd schema with an extra attribute &quot;module&quot; and then user need pack his JDBC driver as module.<br><br>I use the code below to load the model and the driver class.<br>
<br>Class&lt;?&gt; driverClass = Module.loadClassFromCallerModuleLoader(ModuleIdentifier.fromString(moduleName),  driver);<br>driverClass.newInstance();<br><br>&lt;outbound-connections&gt;<br>
        &lt;database&gt;<br>            &lt;connection module=&quot;com.h2database.h2&quot; driver=&quot;org.h2.jdbcx.JdbcDataSource&quot; name=&quot;db&quot; url=&quot;jdbc:h2:/tmp/test;DB_CLOSE_DELAY=-1&quot; username=&quot;sa&quot; password=&quot;&quot; min-pool-size=&quot;10&quot; max-pool-size=&quot;20&quot; /&gt;<br>
        &lt;/database&gt;<br>&lt;/outbound-connections&gt; <br><br>Does it make sense?<br><br>Thanks<br><br><div class="gmail_quote">2012/7/20 Flemming Harms <span dir="ltr">&lt;<a href="mailto:flemming.harms@gmail.com" target="_blank">flemming.harms@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br><br>I&#39;m trying to finish <a href="https://issues.jboss.org/browse/AS7-1371" target="_blank">https://issues.jboss.org/browse/AS7-1371</a> but I ran into a problem with the class loader. I need way to load the class for a specified JDBC driver, but I can&#39;t seem to figure out how to make it available on the classpath too my authentication service.<br>

<br>I try to load the connection class like this, and testing it with the existing H2 JDBC driver:<br>ClassLoader original = null;<br>        try {<br>            original = Thread.currentThread().getContextClassLoader();<br>

            if (original != null) {<br>                Thread.currentThread().setContextClassLoader(null);<br>            }<br>            Class.forName(this.driver).newInstance();<br>        } finally {<br>            if (original != null) {<br>

                Thread.currentThread().setContextClassLoader(original);<br>            }<br>}<br> <br>The user can setup a outbound connection to a database for authentication, by using the configuration below <br><br> &lt;security-realm name=&quot;ManagementRealm&quot;&gt;<br>

      &lt;authentication&gt;<br>           &lt;local default-user=&quot;$local&quot;/&gt;<br>           &lt;database connection=&quot;db&quot; plain-text=&quot;true&quot;&gt;<br>             &lt;!-- simple-select-users table=&quot;users&quot; username-field=&quot;user&quot; password-field=&quot;password&quot;/ --&gt;<br>

             &lt;sql-select-users sql=&quot;select user,password from users where user = ?&quot; /&gt;<br>           &lt;/database&gt;<br>      &lt;/authentication&gt; <br>&lt;/security-realm&gt;<br><br>&lt;outbound-connections&gt;<br>

        &lt;database&gt;<br>            &lt;connection driver=&quot;org.h2.jdbcx.JdbcDataSource&quot; name=&quot;db&quot; url=&quot;jdbc:h2:/tmp/test;DB_CLOSE_DELAY=-1&quot; username=&quot;sa&quot; password=&quot;&quot; min-pool-size=&quot;10&quot; max-pool-size=&quot;20&quot; /&gt; <br>

        &lt;/database&gt;<br>&lt;/outbound-connections&gt; <br><br>Any suggestions how to solve this?<br><br>Thanks!<br><br>br<span class="HOEnZb"><font color="#888888"><br>Flemming<br>
</font></span></blockquote></div><br>