<!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;"> </p><p><span style="font-family: calibri,verdana,arial,sans-serif;">Configuration details:</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </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;">                             </span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><local-tx-datasource></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><jndi-name>defaultDS</jndi-name></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><connection-url>jdbc:mysql://mysql-hostname:3306/jbossdb</connection-url></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><driver-class>com.mysql.jdbc.Driver</driver-class></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><user-name>icdt</user-name></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><password>icdt</password></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"> <min-pool-size>20</min-pool-size></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;">  <max-pool-size>100</max-pool-size></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><security-domain>MySqlDbRealm</security-domain></span></p><p><br/><span style="font-size: 10pt; color: black; font-family: calibri,verdana,arial,sans-serif;">     </span></p><p style="text-align: start;"><span style="font-family: calibri,verdana,arial,sans-serif;"><span style="font-size: 10pt; color: black;">   </span><span style="font-size: 10pt;">5.   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;">   6.  <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;">               </span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><application-policy name = "MySqlDbRealm"></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><authentication></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required"></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><module-option name = "principal">uname</module-option></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><module-option name = "userName">uname</module-option></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><module-option name ="password">pwd</module-option></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"><module-option name ="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"></login-module></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"></authentication></span></p><p style="padding-left: 60px;"><span style="font-family: calibri,verdana,arial,sans-serif;"></application-policy></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: calibri,verdana,arial,sans-serif;">  7.  <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;">                <em><security-domain>MySqlDbRealm</security-domain></em></span></p><p><span style="font-family: calibri,verdana,arial,sans-serif;"><span style="font-size: 10pt;"><em>  8.  </em></span>Ensured that the <type-mapping>mySQL</type-mapping> property vale present in mysql-ds.xml file is the same as the <type-mapping>              property in standardjbosscmp-jdbc.xml file.</span></p><p>  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </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;"> </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>