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.
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
Joined: Aug 05, 2006
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.