JBoss Community

Re: @Service annotated bean lifecycle methods

created by piotrekde in Beginner's Corner - View the full discussion

Thanks Jaikiran for the answer. I tried to simplify this issue as most as it is possible. So here is my service bean:

 

@Service
public class RemoteTrafficManagerBean implements RemoteTrafficManager {
 
    public void start() throws Exception {
        System.out.println("Starting service bean");
        clearStatistics();
    }
 
    public void create() throws Exception {
        System.out.println("Creating service bean");
    }
 
    (... some other methods ...)
 
    public void someBusinessMethod() {
     (...)
    }
}

 

Logs are otputed to the standard out to make sure that it is no logging issue. RemoteTrafficManager is injected into another session bean using @EJB annotation. Also, someBusinessMethod is called from this bean. I am sure that RemoteTrafficManagerBean was instantiated, because some additional logging is flushed into console from its business methods (they do not work appropriately because initialization has not been done).

 

I 've put logging from all levels into file:

 

msc@nitrogen:~> cat jboss\ service\ logs |grep 'Starting service bean'

msc@nitrogen:~> cat jboss\ service\ logs |grep 'Creating service bean'

 

But there is no entry about starting/creating RemoteTrafficManagerBean. I use JBoss 5.0.0 with HornetQ.

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community