It's not a secret anymore!
The moose likes JBoss/WildFly and the fly likes JBoss Datsource Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss Datsource Issue" Watch "JBoss Datsource Issue" New topic

JBoss Datsource Issue

Anu Wadhwa

Joined: Jul 28, 2009
Posts: 4

I need to deploy multiple enterprise applications on JBoss which define their own datasource with the same jndi-name jdbc/appSM. I defined the datasource as follows in one of the EAR

I have oracle-ds.xml in my app.ear/META-INF.

jboss-web.xml in webgui.war/WEB-INF dir
<?xml version="1.0" encoding="UTF-8"?>

In WEB-INF/web.xml,
<description>Oracle Datasource</description>

The above works fine. Now if I try to use the same jndi-name again in another EAR I get an error that the resource is already bound. Can anyone tell me how can I make a datasource local to the application? Basically I want the datasource to be visible only within the Enterprise app.

Thanks !!
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

The jndi-name of the datasource is always global and hence has to be unique within a server. You won't be able to deploy 2 datasources with the same jndi name on the same server.

[My Blog] [JavaRanch Journal]
I agree. Here's the link:
subject: JBoss Datsource Issue
It's not a secret anymore!