Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the correct way to create a MDB?

 
Frederico Benevides
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create my MDB



But when I use theses, I get an error



So, if I change my property "destinationName" to "destination" only shows the error



Thank you,

Frederico
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.naming.NameNotFoundException: jms not bound


JBoss by default binds queues to the "queue" context in the Global JNDI tree. So if your queue is named "xyz", its going to be bound to "queue/xyz" jndi name.

So try changing your destination value in the annotation as follows:


Here's the EJB3 TrailBlazer which might help.
 
Frederico Benevides
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, that worked!

But one doubt.

I changed my ReceptorMDB to this




And for my client ejb to work I had to use this



I would like to know why I cannot use mappedName as mappedName="ReceptorQueue" since I put my Receptor with name "ReceptorQueue"

Thank you
 
Cloey Tan
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was just wondering whether you have included the queue somewhere inside the jboss-related xml configuration file?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic