0

I need help.

The Glassfish Admin Console screen below shot below shows that I've set up three JMS Destination Resources. All are identical except for the names. But my JNDI lookup from a local java client (Glassfish is also local) can only see the first two. Client code and console out put is below screen shot.

I don't even know where to look to begin figuring out why one and two work, and three doesn't. Can anyone suggest anything. This should be as basic as it get's. All three are identically set up. None have any additional properties set. I really need help or direction.

Glassfish Admin Console Screen Shot

CODE:

public class SrackOverflow1 {

  public static void main(String[] args) {
    Properties env = new Properties();
    env.put ("java.naming.factory.initial", "com.sun.jndi.fscontext.RefFSContextFactory");
    env.put ("java.naming.provider.url","file:///C:/glassfish4/mq/opt/java/my_broker");
    try {
      Context jndiContext = (Context) new InitialContext(env);

      Queue queueOne   = (Queue) jndiContext.lookup("jms/goSendQueue");
      System.out.println("queueOne ok:\n" + queueOne);

      Queue queueTwo   = (Queue) jndiContext.lookup("jms/goReceiveQueue");
      System.out.println("\nqueueTwo ok:\n" + queueTwo);

      Queue queueThree = (Queue) jndiContext.lookup("jms/goTestQueue");
      System.out.println("\nqueueThree ok:\n" + queueThree);

    } catch (NamingException e) {
      System.out.println("\nThrew Naming Exception\nerror msg: " + e.getMessage() +"\n");
      e.printStackTrace();
    }
  }

CONSOLE:

queueOne ok:
Sun Java System MQ Destination
getName():      goSendQueuq
Class:          com.sun.messaging.Queue
getVERSION():       3.0
isReadonly():       false
getProperties():    {imqDestinationName=goSendQueuq, imqDestinationDescription=A Description for the Destination 
Object}

queueTwo ok:
Sun Java System MQ Destination
getName():      goReceiveQueue
Class:          com.sun.messaging.Queue
getVERSION():       3.0
isReadonly():       false
getProperties():    {imqDestinationName=goReceiveQueue, imqDestinationDescription=A Description for the Destinati
on Object}

Threw Naming Exception
error msg: jms/goTestQueue

javax.naming.NameNotFoundException: jms/goTestQueue
    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 org.america3.testclasses.SrackOverflow1.main(SrackOverflow1.java:21)
George
  • 509
  • 2
  • 9
  • 25
  • Quit shouting! Why is the title of your question capitalized? Are the titles of any other questions capitalized? Learn by example. – camickr Sep 19 '15 at 03:54
  • OK. That was helpful. Any chance you know anything about the topic that might also help? – George Sep 25 '15 at 04:34

0 Answers0