Author |
Message
|
Suja |
Posted: Thu Nov 09, 2006 1:56 am Post subject: Error while executing JMS Tool |
|
|
Novice
Joined: 07 Nov 2006 Posts: 16
|
hi .
i couldnot able to run JmsAdmin tool .i have used file based jndi properties in JMSAdmin.config .its giving me an Exception..." JNDI initializing failed, plz check your setting abd service."
error :javax.naming.NameNotFoundException; remaining name 'c:\JNDI-Directory' .
some one plz tell me what should be done to run JMSAdmin tool . _________________ Suja |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Nov 09, 2006 3:33 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Tell us how you configured it  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jlamond |
Posted: Fri Nov 10, 2006 4:39 am Post subject: |
|
|
Voyager
Joined: 28 May 2002 Posts: 94 Location: Paris
|
You need to create that directory in order to used it ! _________________ Jean-Marc |
|
Back to top |
|
 |
Suja |
Posted: Fri Nov 10, 2006 6:15 am Post subject: |
|
|
Novice
Joined: 07 Nov 2006 Posts: 16
|
Thank you..
but what should be the content of that file.. plz specify abt the content of that file..
jlamond wrote: |
You need to create that directory in order to used it ! |
_________________ Suja |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 10, 2006 6:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It's not a file.
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jlamond |
Posted: Fri Nov 10, 2006 8:03 am Post subject: |
|
|
Voyager
Joined: 28 May 2002 Posts: 94 Location: Paris
|
Then you are using the wrong class _________________ Jean-Marc |
|
Back to top |
|
 |
Suja |
Posted: Fri Nov 10, 2006 11:14 pm Post subject: |
|
|
Novice
Joined: 07 Nov 2006 Posts: 16
|
hi.,
Now, i could run the JMSAdmin. and. i am having ..
Code: |
InitCtx> dis ctx
Contents of InitCtx
.bindings java.io.File
[D] ptpctx javax.naming.Context
a dest1 com.ibm.mq.jms.MQQueue
a cf2 com.ibm.mq.jms.MQConnectionFactory
4 Object(s)
1 Context(s)
3 Binding(s), 2 Administered
|
and my simple sender class is:
Code: |
import javax.naming.*;
import javax.jms.*;
import java.util.*;
public class JmsSender{
public static void main(String args[]) throws JMSException,NamingException{
Hashtable p=new Hashtable();
p.put("INITIAL_CONTEXT_FACTORY","com.sun.jndi.fscontext.RefFSContextFactory");
p.put("PROVIDER_URL","file:/C:/JNDI-Directory");
Context ctx=new InitialContext(p);
ConnectionFactory cf1=(ConnectionFactory)ctx.lookup("cf2");
Destination dest1=(Destination)ctx.lookup("dest1");
Connection c= cf1.createConnection();
Session s=c.createSession(false,Session.AUTO_ACKNOWLEDGE);
MessageProducer pr=s.createProducer(dest1);
c.start();
TextMessage msg=s.createTextMessage("jms text message");
pr.send(msg);
pr.close();
s.close();
c.close();
}
} |
this class has been compiled successfully.But While Executing this class, iam getting the following Exception :
Code: |
Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system p
roperty, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at JmsSender.main(JmsSender.java:11)
|
What Could be the problem here..? _________________ Suja |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Nov 11, 2006 7:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Suja wrote: |
p.put("INITIAL_CONTEXT_FACTORY","com.sun.jndi.fscontext.RefFSContextFactory");
p.put("PROVIDER_URL","file:/C:/JNDI-Directory");
What Could be the problem here..? |
Have you tried
Code: |
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
p.put(Context.PROVIDER_URL, "file:///C:/JNDI-Directory"); |
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
vc1981 |
Posted: Wed Mar 28, 2007 12:45 am Post subject: |
|
|
Apprentice
Joined: 18 Jan 2006 Posts: 46
|
Hi ,
I am completely new to JMS ,i tried to exceute the code mentioned in couple of posts above this .I also created the directory C:/JNDI-Directory
Now when i am executing the code i am getting an error :
Exception in thread "main" javax.naming.NameNotFoundException: cf2
at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400)
at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:327)
at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
at javax.naming.InitialContext.lookup(Unknown Source)
at JmsSender.main(JmsSender.java:11)
Any guidance on this would be highly appreciated ! _________________ Regards ,
VC |
|
Back to top |
|
 |
|