on 05-27-2005 10:23 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Martin:
That worked perfectly. Thank you very much!!!
Peshev:
Thank you for your answer as well.
Thanks to you both, John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.