• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

query Regarding name not bound exception in EJB3...

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

I have a question.I am writing simple program in ejb3 which send message from client and consumer is MDB.After deploying in JBoss, startup time I get the message....Name not bound exception. for OurSampleQueue

Here is my sample client code while looking up:

qconFactory = (QueueConnectionFactory) ctx.lookup("jms/connectionFactory");

connection = qconFactory.createQueueConnection();
session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

queue = (Queue) ctx.lookup("queue/OurSampleQueue");
msg = session.createTextMessage();

sender = session.createSender(queue);

Here is the MDB code sample:

@MessageDriven(name="LongProcessMessageBean", activationConfig = {
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(propertyName="destination", propertyValue="queue/OurSampleQueue")


Now here is the JNDI tree view of JBoss:
this is snap of Global namespace.

+- queue (class: org.jnp.interfaces.NamingContext)
| +- A (class: org.jboss.mq.SpyQueue)
| +- testQueue (class: org.jboss.mq.SpyQueue)
| +- ex (class: org.jboss.mq.SpyQueue)
| +- DLQ (class: org.jboss.mq.SpyQueue)
| +- D (class: org.jboss.mq.SpyQueue)
| +- C (class: org.jboss.mq.SpyQueue)
| +- OurSampleQueue (class: org.jboss.mq.SpyQueue)
| +- B (class: org.jboss.mq.SpyQueue)

Now my question is after successul bound of the name (Which can be seen in JNDI tree view) why we get the name not bound exception.
Please explain me in detail. Thanks in advance.

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

Unfortunately, I don't have a lot of time for detail, but I can give you some pointers to look into:

1. If the client code is in Java SE, you might be connecting to the wrong JNDI context (seems unlikely in this case, but worth checking).
2. From your code snippet, it seems like 'jms/ConnectionFactory' is not bound. This is more likely since JBoss does not bind JMS resources to 'jms/...' by default. The more likely JNDI name is just 'ConnectionFactory'.

Best regards,
    Bookmark Topic Watch Topic
  • New Topic