ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Error while executing JMS Tool

Post new topic  Reply to topic
 Error while executing JMS Tool « View previous topic :: View next topic » 
Author Message
Suja
PostPosted: Thu Nov 09, 2006 1:56 am    Post subject: Error while executing JMS Tool Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Nov 09, 2006 3:33 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Tell us how you configured it
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jlamond
PostPosted: Fri Nov 10, 2006 4:39 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Suja
PostPosted: Fri Nov 10, 2006 6:15 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Nov 10, 2006 6:32 am    Post subject: Reply with quote

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
View user's profile Send private message
jlamond
PostPosted: Fri Nov 10, 2006 8:03 am    Post subject: Reply with quote

Voyager

Joined: 28 May 2002
Posts: 94
Location: Paris

Then you are using the wrong class
_________________
Jean-Marc
Back to top
View user's profile Send private message Send e-mail
Suja
PostPosted: Fri Nov 10, 2006 11:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sat Nov 11, 2006 7:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
vc1981
PostPosted: Wed Mar 28, 2007 12:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Error while executing JMS Tool
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.