Author |
Message
|
veech23 |
Posted: Thu Nov 15, 2007 6:23 pm Post subject: file based JNDI store on linux server from window client |
|
|
Novice
Joined: 25 Apr 2007 Posts: 23 Location: canberra
|
server : Linux
MQ : WMQ 6.0.2.0
Jndi : com.sun.jndi.fscontext.RefFSContextFactory
Hi All, i am able to configure my server to use file based JNDI and i am able to create JMS administered objects from command line on redhat linux.
I am trying to connect from Windows java client using the following code,
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"; );
env.put(Context.PROVIDER_URL, "file:///<linux hostname>/var/jndi" ;
Context ctx = new InitialDirContext(env);
i got Error : javax.naming.NameNotFoundException; remaining name 'C:\<linux hostname>\var\jndi'
Is there any thing i am missing here? any pointers are greatly appreciated.
veeru |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Nov 15, 2007 8:31 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Can you actually get at the Linux file from your Windows machine? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 16, 2007 2:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The file URL doesn't work like that. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 16, 2007 4:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
as URL you might want to try: "ftp://<linux hostname>/var/jndi/.bindings"  _________________ MQ & Broker admin |
|
Back to top |
|
 |
veech23 |
Posted: Sun Nov 18, 2007 6:57 pm Post subject: |
|
|
Novice
Joined: 25 Apr 2007 Posts: 23 Location: canberra
|
Thanks jeff. The other way i could think of is using WMQ as my JNDI provider but its a pity file based JNDI does not work like the way i wanted.
fjb_saper, i tried ftp/http by exposing the directory in apache, comes back with unknown protocol.
veeru |
|
Back to top |
|
 |
sysmq012 |
Posted: Sun Nov 18, 2007 11:13 pm Post subject: It should work |
|
|
Newbie
Joined: 11 Feb 2007 Posts: 9
|
Do you have samba configured so that file:///<linux hostname>/var/jndi is accessible from your windows box? try to access it from the windows explorer.
another issue to check is whether the user that runs the application has permissions to the linux file system.
Ophir |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 19, 2007 4:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Guys,
This is getting way too complicated...
Just ftp the .bindings file over to your windows box (binary mode) and give the file url to the location (directory) of the file in windows... And remember once you start your app the .bindings file is supposed to be STATIC i.e. it won't change...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Nov 19, 2007 4:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I very much doubt that the MQ JMS provider (well, the sun file system context implementation) has any protocol support other than "the local file system" built in - so I doubt that it will be able to read a samba link in the way sysmq012 has suggested. I h'aint tried it though.
If veech23 really wants one file to be used a bindings by every client - then veech23 needs to mount the file system holding that file on every client.
Or use a different JNDI provider than the file system context... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|