| Author |
Use of "mappedName" attribute with @MessageDriven EJB3.0
|
Gurumurthy Ramamurthy
Ranch Hand
Joined: Feb 13, 2003
Posts: 272
|
|
Hi there, I am learning EJB3.0. I have written a MDB using @MessageDriven annotation and succeeded too. But, I am little bit confused about the attribute "mappedName". Is this same like jndi name we give with @ActivationConfigProperty in activationConfig attribute. What exactly "mappedName" would do? Can you guys please explain this? Thanks, Guru
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
|
|
What exactly "mappedName" would do? Can you guys please explain this?
From here,
The mappedName attribute specifies the JNDI name for the bean instance.
|
[My Blog] [JavaRanch Journal]
|
 |
igor bolsovitch
Greenhorn
Joined: Feb 22, 2009
Posts: 12
|
|
Hi,
Does mappedName attribute work with @MessageDriven EJB3.0 annotation with jboss 5.0 AS ?
it seems to be not working because I have to add a property like this so that he knows what queue to use :
I found a Jira ticket that look like to my problem (@EJB in JSF ignores mappedName) https://jira.jboss.org/jira/browse/JBAS-4399
PS : Jaikiran Pai the link here is no more good
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
|
|
igor bolsovitch wrote:
Does mappedName attribute work with @MessageDriven EJB3.0 annotation with jboss 5.0 AS ?
No it doesn't. The mappedName in JBoss is considered to be the JNDI name of the bean. Since MDBs don't get bound to the JNDI for lookup, the mappedName isn't used for MDBs.
igor bolsovitch wrote:
it seems to be not working because I have to add a property like this so that he knows what queue to use :
That's the correct way.
igor bolsovitch wrote:
PS : Jaikiran Pai the link here is no more good
Unfortunately, the trailblazer is no longer available. The EJB3 tutorials for JBoss AS5 can now be found here
|
 |
igor bolsovitch
Greenhorn
Joined: Feb 22, 2009
Posts: 12
|
|
igor bolsovitch wrote:
Does mappedName attribute work with @MessageDriven EJB3.0 annotation with jboss 5.0 AS ?
No it doesn't. The mappedName in JBoss is considered to be the JNDI name of the bean. Since MDBs don't get bound to the JNDI for lookup, the mappedName isn't used for MDBs.
+1 Glassfish
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
|
|
igor bolsovitch wrote:
+1 Glassfish
Sorry, i don't get what you mean here
|
 |
igor bolsovitch
Greenhorn
Joined: Feb 22, 2009
Posts: 12
|
|
Just because in glassfish it works ... as expected:
Annotation Type MessageDriven
Optional Element Summary
...
mappedName
A product specific name(e.g. global JNDI name of a queue) that this message-driven bean should be mapped to.
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
|
|
igor bolsovitch wrote:Just because in glassfish it works  ... as expected:
Annotation Type MessageDriven
Optional Element Summary
...
mappedName
A product specific name(e.g. global JNDI name of a queue) that this message-driven bean should be mapped to.
You just posted only a part of the javadocs The more important part of the javadocs reads as follows:
...Application servers are not required to support any particular form or type of mapped name, nor the ability to use mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is portable.
|
 |
igor bolsovitch
Greenhorn
Joined: Feb 22, 2009
Posts: 12
|
|
Mea culpa,
It was a part I found in the top table (Summary)
I have serious problem with Jboss messaging.
I have 2 EJB
Stateless : OrderBean
and
MDB : EmailSenderBean
The first (OrderBean) has to send message to the queue orderQueue.
The second (EmailSenderBean) should realize that a new message has come (method onMessage) and should execute a buisiness method (Send an E-mail)
But it doesn't work : It seems that EmailSenderBean does not listen, because when I deploy my application I see this error in jboss:
Is that normal that he logs about the DLQ while in MDB I have :
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
|
|
|
Each queue has a Dead letter queue. By default it is queue/DLQ which is provided by default in JBoss. The WARN message indicates that the DLQ is not being found. Did you do any changes to the AS?
|
 |
 |
|
|
subject: Use of "mappedName" attribute with @MessageDriven EJB3.0
|
|
|