Are you trying to do the lookup from outside JBoss? Home references for session beans can be retrieved remotely via JNDI, however, datasources (*-ds.xml) and in general items bound at "java:" cannot be retrieved remotely (check JCA specification).
Hope this helps :-)
Can you help me by sending some sample example about how to lookup datasource?
Thanks in advance
you can find further information about how to configure datasources in the following wiki page:
it includes how to set up a datasource in order to access it remotely.
The following is a sample code on how to do a lookup for a datasource:
Context ctx; ctx = new InitialContext(); ConnectionFactory cf = (ConnectionFactory)ctx.lookup(java:/MySQL); Connection c = cf.getConnection();
This is a very generic example, but should give you an idea of the steps required.