I am playing around with EJB3 on 4.0.4.CR2, and cannot get the callbacks 
PostConstruct or PreDestroy to work.

I saw an issue from about 8 months ago, that said this was a bug that needed to 
be input via JIRA, but did not find one there, nor a resolution. 

Was this fixed ?



Here is the bean, and it's interface

package com.parasynthion.testbed.ejb;
  | 
  | import javax.ejb.*;
  | import javax.annotation.*;
  | import org.apache.log4j.*;
  | 
  | @Stateless
  | public class TraderBean implements Trader
  | {
  |     Logger logger=Logger.getLogger("CONSOLE");
  |     
  |     public void buy(String symbol,int quantity)
  |     {
  |             System.out.println("Buying " + quantity + " of "+symbol);
  |     }
  |     
  |     public void sell(String symbol,int quantity)
  |     {
  |             System.out.println("Selling " + quantity + " of "+symbol);
  |     }    
  |     
  |     @PostConstruct
  |     protected void postConstruct()
  |     {
  |         logger.info("#################### Post Construct called 
########################");
  |     }
  |     
  |     @PreDestroy
  |     protected void preDestroy()
  |     {
  |         logger.info("##################### Pre destroy called 
#############################");
  |     }
  |     
  | }

package com.parasynthion.testbed.ejb;
  | 
  | import javax.ejb.*;
  | 
  | @Local
  | public interface Trader
  | {
  |     public void buy(String symbol,int qty);
  |     public void sell(String symbol,int qty);
  | }

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3943317#3943317

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3943317


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to