This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

weblogic.jms. common. JMSException: Invalid destination name:

Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have configured WebLogic Server 8.1. I logged on to administration console and went to

examples -> services -> JMS -> ConnectionFactories

There are three examples already listed there...

exampleQueue, exampleTopic, exampleTrader

I wrote a jave program to send messages to this exampleQueue. I left the default jndi name - weblogic.examples.jms.QueueConnectionFactory in the weblogic console as such.

my code goes like this...

public static final String JMS_FACTORY = "weblogic.examples.jms.QueueConnectionFactory";
public static final String QUEUE = "exampleQueue";


created an InitialContext object with
weblogic.jndi.WLInitialContextFactory as the INITIAL_CONTEXT_FACTORY
PROVIDER_URL as t3://localhost:7001/

the contect gets created.

then i try to create a QueueConnectionFactory by loking up the context

QueueConnectionFactory qcf = (QueueConnectionFactory) context.lookup(JMS_FACTORY);

this also goes thru

//then i get a QueueConnection, queue session
QueueConnection con = qcf.createQueueConnection();
QueueSession session = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

till this point it works

now, i try to lookup the queue-

try {
System.out.println("Lookup queue");
queue = (Queue) c.lookup(QUEUE);
catch (NamingException ne) {
System.out.println("Naming Exception - looking up queue");
try {
queue = session.createQueue(QUEUE);
c.bind(QUEUE, queue);
System.out.println("Bound context to queue");
catch (Throwable th) {
System.out.println("Exception looking up queue: " + th.getMessage());


Naming Exception - looking up queue
weblogic.jms.common.JMSException: Invalid destination name: exampleQueue
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.j
at weblogic.rmi.internal.BasicRemoteRef.invoke(
at weblogic.jms.dispatcher.DispatcherImpl_812_WLStub.dispatchSyncNoTranF
uture(Unknown Source)
at weblogic.jms.dispatcher.DispatcherWrapperState.dispatchSyncNoTran(Dis
at weblogic.jms.client.JMSSession.createDestination(
at weblogic.jms.client.JMSSession.createQueue(
at ObjectSender.init(
at ObjectSender.<init>(
at ObjectSender.<init>(
at ObjectSender.main(
Caused by: weblogic.jms.common.JMSException: Invalid destination name: exampleQu
at weblogic.jms.frontend.FEManager.destinationCreate(

at weblogic.jms.frontend.FEManager.invoke(
at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.jav
at weblogic.jms.dispatcher.DispatcherImpl.dispatchAsyncInternal(Dispatch
at weblogic.jms.dispatcher.DispatcherImpl.dispatchSyncNoTranFuture(Dispa
at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(
at weblogic.rmi.internal.BasicServerRef$
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
at weblogic.kernel.ExecuteThread.execute(
Exception looking up queue: Invalid destination name: exampleQueue
Not ready to send messages.

Any pointers to solve this problem is welcome.

Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

please ensure, that
- at least one JMS Server is successfully deployed;
- and for this JMS Server you have created at least one JMS Queue (in your case, JNDI name must be "exampleQueue").

Priyaa V Kumar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

I figured out the problem.

The queue name should be a fully qualified name...

QUEUE = "weblogic.examples.jms.exampleQueue";

I ran my test program and looks like the messages are sent to the queue.

I also see the messages in my queue in the Weblogic Server Console

See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic