How do configure a resource-ref for a war in JBoss EAP?

Solution Verified - Updated -

Issue

  • I have defined the datasource in the web.xml in the ear.  It complained about the Datasource in jboss-web.xml, If I define it there it says," expected one jndi name". But If I remove it  from jboss-web.xml it says no valid "jndi-name" though already the jndi-name is  there in web.xml.

  • Getting the following Exception in the server logs :

 ERROR [STDERR] (main) javax.naming.NameNotFoundException: Example_datasource not bound
 ERROR [STDERR] (main) java.lang.Exception: Data source not found!!!

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 4.3.x
    • 5.x

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