title: Spring Error: org.springframework.beans.factory.BeanCreationException
body: <p>I have a web application which I am exporting as EAR and trying to deploy on Websphere 6.1 application server. </p>
  
  <p>The deployment goes fine. Even, the index page loads fine which is a login screen. </p>
  
  <p>However, on entering credentials and hitting enter, the next page does not load and HTTP 500 Internal Server Error is thrown. </p>
  
  <p>The next page which gets loaded is a JSP having a country drop down, whose values gets fetched from database via hibernate. </p>
  
  <p>I have Datasource created in Websphere with all details and even test connection succeeds. </p>
  
  <p>However, I get the below error on checking the server System.out logs:</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ds': 
  Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: 
  Context: uschwasvmdev04Cell01/clusters/URMDUS, name: jdbc/mydbXA: First component in name 
  mydbXA not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: 
  IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
  </code></pre>
  
  <p>The description of NameNotFoundException says:</p>
  
  <p>"This exception is thrown when a component of the name cannot be resolved because it is not bound. "</p>
  
  <p>JNDI Lookup in my services.xml also seems fine:</p>
  
  <pre><code>&lt;jee:jndi-lookup id="ds" jndi-name="jdbc/mydbXA" resource-ref="true" /&gt;
  </code></pre>
  
  <p>What am I missing here ?</p>
  
  <p>Thanks for reading!</p>