<!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">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.naming.NameNotFoundException: Name jdbc is not bound in this Context
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/skassam">Shinan Kassam</a> in <i>JCA</i> - <a href="http://community.jboss.org/message/543473#543473">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>I have a jndi resource setup and working correctly. I was using JDBCRealm but now that I have my datasource setup I'd like to use DatasourceRealm.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I get "javax.naming.NameNotFoundException: Name jdbc is not bound in this Context" error when trying to login</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>context.xml:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div id="_mcePaste">&lt;Context&gt;</div><div id="_mcePaste">&#160;&#160; &lt;Realm debug="99"</div><div id="_mcePaste"> className="org.apache.catalina.realm.DataSourceRealm"</div><div id="_mcePaste"> dataSourceName="jdbc/MyDb"</div><div id="_mcePaste"> userTable="usrsec"</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160; userNameCol="usrsec_userid"</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160; userCredCol="usrsec_pswd"</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160; userRoleTable="usrsec" roleNameCol="usrsec_level"</div><div id="_mcePaste"> /&gt;</div><div id="_mcePaste">&lt;Valve className="flex.messaging.security.TomcatValve"/&gt;</div><div id="_mcePaste">&lt;/Context&gt;</div><div> </div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>jboss-web.xml:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><p>&lt;jboss-web&gt;</p><p><span> </span>&lt;resource-ref&gt;</p><p><span> </span>&lt;res-ref-name&gt;jdbc/MyDb&lt;/res-ref-name&gt;</p><p><span> </span>&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;</p><p><span> </span>&lt;jndi-name&gt;java:jdbc/MyDb&lt;/jndi-name&gt; </p><p><span> </span>&lt;res-auth&gt;Container&lt;/res-auth&gt;</p><p><span> </span>&lt;/resource-ref&gt;</p><p>&lt;/jboss-web&gt;</p></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Part of my web.xml:</p><p><p>&lt;resource-ref&gt; </p><p><span> </span>&lt;description&gt;DB Connection&lt;/description&gt;</p><p><span> </span>&lt;res-ref-name&gt;jdbc/MyDb&lt;/res-ref-name&gt; </p><p><span> </span>&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt; </p><p><span> </span>&lt;res-auth&gt;Container&lt;/res-auth&gt; </p><p><span> </span>&lt;/resource-ref&gt; </p></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>database-ds.xml:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><p>&lt;datasources&gt;</p><p>&#160; &lt;local-tx-datasource&gt;</p><p>&#160;&#160;&#160; &lt;jndi-name&gt;jdbc/MyDb&lt;/jndi-name&gt;</p><p>&#160;&#160;&#160; &lt;!-- Sybase jConnect URL for the database. </p><p>&#160;&#160;&#160; NOTE: The hostname and port are made up values. The optional</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; database name is provided, as well as some additinal Driver</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; parameters.</p><p>&#160;&#160;&#160; --&gt;</p><p>&#160;&#160;&#160; &lt;connection-url&gt;jdbc:ianywhere:DRIVER=SQL Anywhere 10;UID=xxx;PWD=xxx;ENG=HostServer;LINKS=tcpip(HOST=10.6.1.99;DoBroadcast=None)&lt;/connection-url&gt;</p><p>&#160;&#160;&#160; &lt;driver-class&gt;ianywhere.ml.jdbcodbc.jdbc3.IDriver&lt;/driver-class&gt;</p><p>&#160;&#160;&#160; &lt;user-name&gt;xxx&lt;/user-name&gt;</p><p>&#160;&#160;&#160; &lt;password&gt;xxx&lt;/password&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span> </span>&#160;</p><p><span> </span>&lt;!--pooling parameters--&gt;</p><p>&#160;&#160;&#160; &lt;min-pool-size&gt;1&lt;/min-pool-size&gt;</p><p>&#160;&#160;&#160; &lt;max-pool-size&gt;5&lt;/max-pool-size&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span> </span>&#160;</p><p>&#160;&#160;&#160; &lt;!--&lt;exception-sorter-class-name&gt;org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter&lt;/exception-sorter-class-name&gt;--&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- sql to call when connection is created --&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- sql to call on an existing pooled connection when it is obtained from pool --&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;check-valid-connection-sql&gt;SELECT dbInfo_id FROM dbInfo&lt;/check-valid-connection-sql&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;metadata&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;type-mapping&gt;Sybase&lt;/type-mapping&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/metadata&gt;</p><p>&#160; &lt;/local-tx-datasource&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;/datasources&gt;</p></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/543473#543473">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JCA at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>