Error creating bean; nested exception is javax.naming.NameNotFoundException: jdbc not bound

Solution Verified - Updated -

Issue

  • Trying to create a bean referencing a datasource via xml as shown below results in the following error:

    <bean id="someDataSourceBean" class="org.springframework.jndi.JndiObjectFactoryBean"> 
    
         <property name="jndiName"> 
    
              <value>jdbc/someDatasource</value> 
    
         </property> 
    
         <property name="resourceRef">           
    
              <value>true</value>
    
         </property>
    
    </bean>
    
    
    
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'someDataSourceBean' defined in class path resource [someXML.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: jdbc not bound
    

Environment

  • RedHat JBoss Enterprise Web Platform (EWP)
    • 5.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content