aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Missed PreDestroy Calls Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Missed PreDestroy Calls" Watch "Missed PreDestroy Calls" New topic
Author

Missed PreDestroy Calls

Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637

Result:
01:23:26,500 INFO [EARDeployer] Started J2EE application: file:/E:/DJ/Certifications
01:23:33,390 INFO [STDOUT] Enter:HelloUserBean.setSessionContext()
01:23:33,390 INFO [STDOUT] Exit:HelloUserBean.setSessionContext()
01:23:33,390 INFO [STDOUT] Enter:HelloUserBean.init(***** N E W *****)
01:23:33,390 INFO [STDOUT] [PostConstruct]
01:23:33,390 INFO [STDOUT] Exit:HelloUserBean.init()
01:23:33,390 INFO [STDOUT] Enter:HelloUserBean.afterBegin()
01:23:33,390 INFO [STDOUT] Exit:HelloUserBean.afterBegin()
01:23:33,390 INFO [STDOUT] Enter:HelloUserBean.sayHello()
01:23:33,390 INFO [STDOUT] Enter:HelloUserBean.instanceMethod()()
01:23:33,390 INFO [STDOUT] Exit:HelloUserBean.instanceMethod()()
01:23:33,390 INFO [STDOUT] Enter:HelloUserBean.afterCompletion()
01:23:33,390 INFO [STDOUT] didCommit:false
01:23:33,390 INFO [STDOUT] Exit:HelloUserBean.afterCompletion()
01:23:33,390 INFO [STDOUT] Enter:HelloUserBean.destroy()
01:23:33,421 INFO [STDOUT] [PreDestroy]
01:23:33,421 INFO [STDOUT] Exit:HelloUserBean.destroy()

EJB 3.0 Core Specification:
---------
4.4.3 Missed PreDestroy Calls
A system exception thrown from the instance's method to the container

Questions:
HelloUserBean invokes instanceMethod() from one of the business interface methods, which throws a System exception, As expected the instance is destroyed but the PreDestroy call back is invoked violating specification.

Can someone explain what is happening here.

****************************************
---------------
Environment
---------------
EJB Version : 3.0
Application Server: JBOSS 4.2.3.GA
J2SE: 1.5 or 5.0
OS: Windows XP
****************************************


SCJP, SCWCD, SCBCD
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Which is your method in the code marked for PreDestroy callback? Can you post the complete code please?


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
Here is the PreDestroy method


I had used jboss-4.2.3.GA as the application server.
Looks like this is yet another case of jboss-4.2.3.GA violating ejb 3.0 specification.
With so much less time remaining & my request post for selling the Sun Voucher being removed by moderators as "Spam", looks like i definetly started the preparation on a wrong note.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

my request post for selling the Sun Voucher being removed by moderators as "Spam"

Really ? Such requests usually end at the Blatant Advertising forum. It's there. Those removed were duplicates.


[My Blog]
All roads lead to JavaRanch
 
 
subject: Missed PreDestroy Calls
 
Similar Threads
invoking EJB via Http call using Jboss
EJB Spec violation
Missed PreDestroy callback calls
EJB Spec violationg for session bean rules.
ETS Question doubts