we have a jar library util that manage some of the logic of connection to db and store the data in memory. Well, this works fine in tomcat because we can configure the datasource in the $CATALINA_HOME/conf/context.xml and everything work's just fine.
How i can configure a datasource in jboss (4.2.3.GA) that's can be see by all the war, ear or apps deployed and of course this jar util that's it's deployed in the $JBOSS_HOME/server/<instance>/lib ?
Thanks :)
UPDATE:
I specifically want to do:
"2a. Shared resource configuration
Use this option if you wish to define a datasource that is shared across multiple JBoss Web applications, or if you just prefer defining your datasource in this file.
This author has not had success here, although others have reported so. Clarification would be appreciated here.
<Resource name="jdbc/postgres" auth="Container"
type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://127.0.0.1:5432/mydb"
username="myuser" password="mypasswd" maxActive="20" maxIdle="10" maxWait="-1"/>
source: https://docs.jboss.org/jbossweb/2.1.x/jndi-datasource-examples-howto.html
Well, i'm in the part of "Clarification would be appreciated here"...
Ok, this toke me about a week of researching:
Create a *-ds.xml file.
In the datasource definition add the following tag:
<use-java-context>false</use-java-context>
Then, in the java code we can call it like: