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