title: GetConnection object not returning connection object
body: <p>i am getting an exception on line </p>
  
  <pre><code>ds=(DataSource) jndiCntx.lookup("java:/MySqlDS");
  return ds.getConnection();
  </code></pre>
  
  <p>It will not returning  connection object .</p>
  
  <p>and my xml file also contain <code>&lt;jndi-name&gt;MySqlDS&lt;/jndi-name&gt;</code></p>
  
  <p>but still i get an error as </p>
  
  <blockquote>
    <p>"org.jboss.resource.adapter.jdbc.WrapperDataSource cannot be cast to javax.sql.DataSource".</p>
  </blockquote>
  
  <p>Now what was the problem and what is the solution?
  Thanx in advance.</p>