Believe me Norman - I'm frustrated now...
I had JBoss 3.2.1 and was using *-ds.xml files. When I wasnt able to get Datasource working on 3.2.1, I switched to 3.0.2 and tried *-service.xml files.
Though with 3.0.2 and *-service.xml files, I was able to see the following lines at
http://localhost:8080/jmx-console/index.jsp :
name=msSQLDS,service=LocalTxCM
name=msSQLDS,service=LocalTxDS
name=msSQLDS,service=LocalTxPool
These lines, according to me , indicates that my DataSource named 'msSQLDS' has been registered. But unfortunately I'm not being able to get datasource from my EJB (BMP) by saying :
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("java:comp/msSQLDS");
I have also tried using "java:msSQLDS" and "java:env/msSQLDS".
Also , I tried :
Enumeration enum = ctx.list("/");
while (enum.hasMoreElements())
System.out.println(" -- " + enum.nextElement() );
which prints all other namings except msSQLDS (though it is getting printed in jmx-console) :
14:30:09,655 INFO [STDOUT] -- UIL2XAConnectionFactory: org.jboss.mq.SpyXAConn
ctionFactory
14:30:09,655 INFO [STDOUT] -- topic: org.jnp.interfaces.NamingContext
14:30:09,655 INFO [STDOUT] -- jmx:vkhattar:rmi: org.jboss.jmx.adaptor.rmi.RMI
daptorImpl
14:30:09,655 INFO [STDOUT] -- queue: org.jnp.interfaces.NamingContext
14:30:09,655 INFO [STDOUT] -- ConnectionFactory: org.jboss.mq.SpyConnectionFa
tory
14:30:09,655 INFO [STDOUT] -- RMIConnectionFactory: org.jboss.mq.SpyConnectio
Factory
14:30:09,655 INFO [STDOUT] -- UserTransaction: org.jboss.tm.usertx.client.Cli
ntUserTransaction
14:30:09,655 INFO [STDOUT] -- ejb: org.jnp.interfaces.NamingContext
14:30:09,655 INFO [STDOUT] -- invokers: org.jnp.interfaces.NamingContext
14:30:09,655 INFO [STDOUT] -- jmx: org.jnp.interfaces.NamingContext
14:30:09,655 INFO [STDOUT] -- UILXAConnectionFactory: org.jboss.mq.SpyXAConne
tionFactory
14:30:09,655 INFO [STDOUT] -- AccountBean: $Proxy30
14:30:09,655 INFO [STDOUT] -- UILConnectionFactory: org.jboss.mq.SpyConnectionFactory
Pls. Help.