<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    javax.jms.JMSSecurityException: User null is NOT authenticated
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/jbossrulzz">Rajesh Kumar</a> in <i>JBoss Messaging</i> - <a href="http://community.jboss.org/message/637083#637083">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><span style="font-family: calibri,verdana,arial,sans-serif;">I am getting the "User null is NOT authenticated" exception in JBoss after migrating from HSQLDB to Mysql for JBoss Messaging.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: calibri,verdana,arial,sans-serif;">Configuration details:</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: calibri,verdana,arial,sans-serif;">JBoss Server 5.1 (4 node cluster)</span></p><p><span style="font-family: calibri,verdana,arial,sans-serif;">Mysql 5.5</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: calibri,verdana,arial,sans-serif;">Heres what i did to migrate from HSQLDB to Mysql:</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ol style="list-style-type: decimal;"><li><span style="font-size: 10pt; font-family: calibri,verdana,arial,sans-serif;">Copied the Mysql JDBC driver (mysql-connector-java-5.1.1.4-bin) to the lib folder of the nodes in JBoss.</span></li><li><span style="font-size: 10pt; font-family: calibri,verdana,arial,sans-serif;">Replacde the file <span style="color: black;">hsqldb-ds.xml with mysql-ds.xml in the deploy folder in JBoss.</span></span></li><li><span style="font-size: 10pt; color: black; font-family: calibri,verdana,arial,sans-serif;">Replaced the file hsqldb-persistence-service.xml with mysqldb-persistence-service.xml in the messaging folder under deploy in JBoss.</span></li><li><span style="font-size: 10pt; color: black; font-family: calibri,verdana,arial,sans-serif;">Updated the file mysql-ds.xml to have the following:</span></li></ol><p><span style="font-size: 10pt; color: black; font-family: calibri,verdana,arial,sans-serif;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;local-tx-datasource&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;jndi-name&gt;defaultDS&lt;/jndi-name&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;connection-url&gt;jdbc:mysql://mysql-hostname:3306/jbossdb&lt;/connection-url&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;user-name&gt;icdt&lt;/user-name&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;password&gt;icdt&lt;/password&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;transaction-isolation&gt;TRANSACTION_READ_COMMITTED&lt;/transaction-isolation&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"> &lt;min-pool-size&gt;20&lt;/min-pool-size&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&#160; &lt;max-pool-size&gt;100&lt;/max-pool-size&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;security-domain&gt;MySqlDbRealm&lt;/security-domain&gt;</span></p><p><br/><span style="font-size: 10pt; color: black; font-family: calibri,verdana,arial,sans-serif;">&#160;&#160;&#160;&#160; </span></p><p style="text-align: start;"><span style="font-family: calibri,verdana,arial,sans-serif;"><span style="font-size: 10pt; color: black;">&#160;&#160; </span><span style="font-size: 10pt;">5.&#160;&#160; Uncommented the "guest=guest" entry in the messaging-users file.</span></span></p><p><span style="font-size: 10pt; font-family: calibri,verdana,arial,sans-serif;"><br/></span></p><p><span style="font-family: calibri,verdana,arial,sans-serif;">&#160;&#160; 6.&#160; <span style="font-size: 10pt;"> </span><span style="font-size: 10pt;">Added the following in the login-config file present in jboss/conf folder:</span></span></p><p><span style="font-size: 10pt; font-family: calibri,verdana,arial,sans-serif;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;application-policy name = "MySqlDbRealm"&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;authentication&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required"&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;module-option name = "principal"&gt;uname&lt;/module-option&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;module-option name = "userName"&gt;uname&lt;/module-option&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;module-option name ="password"&gt;pwd&lt;/module-option&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;module-option name ="managedConnectionFactoryName"&gt;jboss.jca:service=LocalTxCM,name=DefaultDS&lt;/module-option&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;/login-module&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;/authentication&gt;</span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">&lt;/application-policy&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: calibri,verdana,arial,sans-serif;">&#160; 7.&#160; <span style="font-size: 10pt;">Added a reference to the MySqlDbRealm in the mysql-ds file by adding the following:</span></span></p><p><span style="font-size: 10pt; font-family: calibri,verdana,arial,sans-serif;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <em>&lt;security-domain&gt;MySqlDbRealm&lt;/security-domain&gt;</em></span></p><p><span style="font-family: calibri,verdana,arial,sans-serif;"><span style="font-size: 10pt;"><em>&#160; 8.&#160; </em></span>Ensured that the &lt;type-mapping&gt;mySQL&lt;/type-mapping&gt; property vale present in mysql-ds.xml file is the same as the &lt;type-mapping&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; property in standardjbosscmp-jdbc.xml file.</span></p><p>&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: calibri,verdana,arial,sans-serif;">I am guessing, i am missing some configuration which is causing the issue. Could someone educate me on what needs to be updated to fix this issue. I see a few people have the same issue, but was not able to find a concrete solution or a pointer to the root cause of the issue.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: calibri,verdana,arial,sans-serif;">Thanks</span></p><p><span style="font-family: calibri,verdana,arial,sans-serif;">Rajesh</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 10pt; font-family: calibri,verdana,arial,sans-serif;"><br/></span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/637083#637083">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Messaging at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2042">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>