• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Use of "mappedName" attribute with @MessageDriven EJB3.0

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

What exactly "mappedName" would do? Can you guys please explain this?



From here,

The mappedName attribute specifies the JNDI name for the bean instance.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

igor bolsovitch wrote:

+1 Glassfish



Sorry, i don't get what you mean here
 
igor bolsovitch
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic