Is it valid to lookup a DataSource or any other non-ejb resource from a java client? When I try to lookup a DataSource from a client, I get a ClassCastException cuz the lookup returns a javax.naming.Reference rather than my DataSource.
- Srini
-
Lookup a resource from a client? (6 messages)
- Posted by: Srinivasan Ranganathan
- Posted on: January 16 2005 03:05 EST
Threaded Messages (6)
- Lookup a resource from a client? by Stephane Vaucher on January 16 2005 04:23 EST
- Datasource not possible by Senthil Rajagopal on January 17 2005 03:46 EST
- Datasource not possible by Stephane Vaucher on January 18 2005 15:29 EST
-
Remote Interface??? by Senthil Rajagopal on January 19 2005 01:31 EST
-
It is Possible by Sanjay Choudhary on January 27 2005 02:02 EST
- Need more information by Anand Tandon on December 21 2005 03:04 EST
-
It is Possible by Sanjay Choudhary on January 27 2005 02:02 EST
-
Remote Interface??? by Senthil Rajagopal on January 19 2005 01:31 EST
- Datasource not possible by Stephane Vaucher on January 18 2005 15:29 EST
-
Lookup a resource from a client?[ Go to top ]
- Posted by: Stephane Vaucher
- Posted on: January 16 2005 04:23 EST
- in response to Srinivasan Ranganathan
Is it valid to lookup a DataSource or any other non-ejb resource from a java client?
Yes, but please be more specific (f.e. adding a scenario, an example, or code).When I try to lookup a DataSource from a client, I get a ClassCastException cuz the lookup returns a javax.naming.Reference rather than my DataSource.- Srini
How are you doing the lookup?
sv -
Datasource not possible[ Go to top ]
- Posted by: Senthil Rajagopal
- Posted on: January 17 2005 03:46 EST
- in response to Srinivasan Ranganathan
Hi Srini,
You cannot lookup and use a datasource from a client.
Regards,
Senthil -
Datasource not possible[ Go to top ]
- Posted by: Stephane Vaucher
- Posted on: January 18 2005 15:29 EST
- in response to Senthil Rajagopal
Senthil,
If the datasource is in jndi, why couldn't it be accessible?
sv -
Remote Interface???[ Go to top ]
- Posted by: Senthil Rajagopal
- Posted on: January 19 2005 01:31 EST
- in response to Stephane Vaucher
Hi Stephane,
Not sure if I am using the right terminology to explain this, but anyways I'll try.
The datasource unlike EJBs, does not implement a remote interface. (Notice the returned object is a javax.naming.Reference rather than DataSource). Hence if you want to lookup datasource, you have to be in the same process.
Hope I am making sense, else let me know, I'll try to explain it differently.
Regards,
Senthil -
It is Possible[ Go to top ]
- Posted by: Sanjay Choudhary
- Posted on: January 27 2005 02:02 EST
- in response to Senthil Rajagopal
Hi,
If it is possible to put object in JNDI then it is also possible to retrieve it. Ofcourse, you may need to deal with security , depending upon the Application Server.
If you are using WAS or WSAD5.0 you may need to tweak classpath and some properties file. Let me know, if you may need more details.
Thanks,
Sanjay -
Need more information[ Go to top ]
- Posted by: Anand Tandon
- Posted on: December 21 2005 03:04 EST
- in response to Sanjay Choudhary
Hi Sanjay,
Thanks for saying it's possible as I'm in the same situation and need to make it work. What tweaks would be required with classpaths etc ?
javax.naming.Reference actually gives the addresses of ten different locations of the DataSource objects.
If I try to find out the class-name of the those objects it gives the the same name as my DB alias with which I configured. I'm using IBM WAS 5.1.
Also, note that I'm able to do it in WAS 3.5
Thanks for all the help !!!
- AT