• 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
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

ejbRemove() and ejbCreate() are never invoked.

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ejbRemove notification signals that the instance is in the process of being removed by the container.
In the ejbRemove method, the instance releases the resources that it is holding.

To test the above statement from EJB specification, I had defined a ejbRemove(), This was never invoked after i killed the JBOSSS
session.

This specification requires that the ejbRemove and the ejbCreate methods of a message-driven
bean be treated as the PreDestroy and PostConstruct lifecycle callback methods, respectively.
If the message-driven bean implements the MessageDrivenBean interface, the PreDestroy
annotation can only be applied to the ejbRemove method. Similar requirements apply to use of
deployment descriptor metadata as an alternative to the use of annotations.

I had the following code


ejbRemove() and ejbCreate() are never invoked.
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please take time to respond to this question.
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Experts/Ranchers, Please take time and reply.
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Deepak,

First please understand that most of the members in here are self contributors like you. So I dont think it is good force them to reply, but normally they respond quickly.

About your problem,

1. Why you have implemented both SessionBean and MessageListener. SessionBeans and MDBs 2 different things.

2. What did you do to create new instance of this MDB (or SB)? Did you send a message? If not it willnot create an instance.

3. Try by adding annotated listener like @PostConstruct. If that one also not being invockeed issue is in somewhere else

Hope this would help to trace the issue

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

First please understand that most of the members in here are self contributors like you. So I dont think it is good force them to reply, but normally they respond quickly.



I hope you have noticed the use of "Please"

Why you have implemented both SessionBean and MessageListener. SessionBeans and MDBs 2 different things. : I understand both are different things , I just implemented them. I think the whole point is the type of annotation used on the top of the class and since the example its @MessageDriven, the methods of SessionBean will simply be ignored and am alright with that.
My concern is ejbRemove() was never invoked???

What did you do to create new instance of this MDB (or SB)? Did you send a message? If not it willnot create an instance
YEs i had sent a message to the destination for which the above MDB is a listener.

Since i want to test ejbRemove and ejbCreate methods, If i had the annotation , i know they will work. I want to test the statement in the specification which i have mentioned in my question.
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic