NameNotFoundException during Spring data source lookup in EAP 6

Solution Verified - Updated -

Issue

  • During a Spring bean initiated lookup of a datasource, javax.naming.NameNotFoundException is raised
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myDatsource' defined in class path resource [applicationContextHibernate.xml] ...
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
        ...
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
        ...
Caused by: javax.naming.NameNotFoundException: ... service jboss.naming.context.java.jboss.exported...
        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:104)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:174)
        at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)
        at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73) [jboss-remote-naming-1.0.10.Final-redhat-1.jar:1.0.10.Final-redhat-1]
        ...
        at java.lang.Thread.run(Thread.java:745)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6
  • Spring

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.