cancel
Showing results for 
Search instead for 
Did you mean: 

JMS Server instance

Former Member
0 Kudos

Using the J2EE Engine Administrator I did the follwoing:

On the Server JMS Provider:

I have added a queue named 'queue1' to the JMS Server Instance of 'default'

Then I added a Queue Connection factory named 'jQCF' to the JMS Server Instance of 'default'.

I can successfully get an Initial Context, but I can not perform a lookup on my Queue Connection Factory named 'jQCF'.

Do I have to restart the J2EE engine to get this to work ?

Do I have to reference the JMS Server Instance (named 'default') inside of the lookup() call.

Do I need to restart anything or somehow reference the JMS Server instance ?

Thanks, John

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thank you Sai:

I am executing the code from a <i>REMOTE client</i>,

and I am able to get an INITIAL_CONTEXT successfully.

I used he following code:

try

{

factory = (QueueConnectionFactory) context.lookup("jmsQCF");

}

catch (NamingException ne)

{

System.out.println( "NamingException -> \"" + ne.getMessage() + "\"");

}

I got the following results:

<b> NamingException NamingException -> "Object not found in lookup of : jmsQCF"</b>

-


I then used he following code:

try

{

factory = (QueueConnectionFactory) context.lookup("java:comp/env/jmsQCF");

}

catch (NamingException ne)

{

System.out.println( "NamingException -> \"" + ne.getMessage() + "\"");

}

and I got a slightly different error:

<b> NamingException NamingException -> "Path to object does not exist at : java:comp"</b>

-


I think it must be a problem with something not started on the J2EE Engine on the Server side, not sure.

Do you have any ideas ?

Thanks, John

Former Member
0 Kudos

Hi John,

Try this :

try {

factory = (QueueConnectionFactory) context.lookup("jmsfactory/default/jQCF");

} catch (NamingException ne) {

System.out.println( "NamingException -> \"" + ne.getMessage() + "\"");

}

Martin

Message was edited by: Martin Grigorov

Answers (3)

Answers (3)

Former Member
0 Kudos

Martin:

That worked perfectly. Thank you very much!!!

Peshev:

Thank you for your answer as well.

Thanks to you both, John

Former Member
0 Kudos

Hello John,

In case you wonder what lookup strings you can use in your remote applications, here is a way to check it :

In the telnet administration execute the following commands :

jump 0

add naming

lsn > C:\my_namings.txt

Then in the text file you will get a tree like structure of all things that can be looked up. Just search there for your connection factory (jQCF). You should see there something like :

  • jmsfactory [Context]

  • default [Context]

jQCF

but with better indent :). From that you can construct the lookup string suggested by Martin.

Hope that helps.

Best Regards

Peter Peshev

Former Member
0 Kudos

Hi John

Can you paste the code which you had written to access the queue

Alternatively you could check this also

The following code illustrates how to lookup a Queue- or a TopicConnectionFactory:

QueueConnectionFactory queueConnectionFactory =

(QueueConnectionFactory) ctx.lookup("java:comp/env/<res-ref-name>");

TopicConnectionFactory topicConnectionFactory =

(TopicConnectionFactory) ctx.lookup("java:comp/env/<res-ref-name");

To look up a Queue or a Topic destination, use the following model:

}Topic theTopic = (Topic) ctx.lookup("java:comp/env/<resource-env-ref-name");

Queue theQueue = (Queue) ctx.lookup("java:comp/env/<resource-env-ref-name");

Sai