<!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;"> </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;"> </p><p>context.xml:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><div id="_mcePaste"><Context></div><div id="_mcePaste">   <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">      userNameCol="usrsec_userid"</div><div id="_mcePaste">      userCredCol="usrsec_pswd"</div><div id="_mcePaste">      userRoleTable="usrsec" roleNameCol="usrsec_level"</div><div id="_mcePaste"> /></div><div id="_mcePaste"><Valve className="flex.messaging.security.TomcatValve"/></div><div id="_mcePaste"></Context></div><div> </div><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>jboss-web.xml:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><p><jboss-web></p><p><span> </span><resource-ref></p><p><span> </span><res-ref-name>jdbc/MyDb</res-ref-name></p><p><span> </span><res-type>javax.sql.DataSource</res-type></p><p><span> </span><jndi-name>java:jdbc/MyDb</jndi-name> </p><p><span> </span><res-auth>Container</res-auth></p><p><span> </span></resource-ref></p><p></jboss-web></p></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Part of my web.xml:</p><p><p><resource-ref> </p><p><span> </span><description>DB Connection</description></p><p><span> </span><res-ref-name>jdbc/MyDb</res-ref-name> </p><p><span> </span><res-type>javax.sql.DataSource</res-type> </p><p><span> </span><res-auth>Container</res-auth> </p><p><span> </span></resource-ref> </p></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>database-ds.xml:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><p><datasources></p><p>  <local-tx-datasource></p><p>    <jndi-name>jdbc/MyDb</jndi-name></p><p>    <!-- Sybase jConnect URL for the database. </p><p>    NOTE: The hostname and port are made up values. The optional</p><p>          database name is provided, as well as some additinal Driver</p><p>          parameters.</p><p>    --></p><p>    <connection-url>jdbc:ianywhere:DRIVER=SQL Anywhere 10;UID=xxx;PWD=xxx;ENG=HostServer;LINKS=tcpip(HOST=10.6.1.99;DoBroadcast=None)</connection-url></p><p>    <driver-class>ianywhere.ml.jdbcodbc.jdbc3.IDriver</driver-class></p><p>    <user-name>xxx</user-name></p><p>    <password>xxx</password></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span> </span> </p><p><span> </span><!--pooling parameters--></p><p>    <min-pool-size>1</min-pool-size></p><p>    <max-pool-size>5</max-pool-size></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span> </span> </p><p>    <!--<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>--></p><p>        <!-- sql to call when connection is created -->              </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        <!-- sql to call on an existing pooled connection when it is obtained from pool --></p><p>        <check-valid-connection-sql>SELECT dbInfo_id FROM dbInfo</check-valid-connection-sql></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --></p><p>      <metadata></p><p>         <type-mapping>Sybase</type-mapping></p><p>      </metadata></p><p>  </local-tx-datasource></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></datasources></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>