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, 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