0 Replies Latest reply: Apr 12, 2012 10:47 AM by MUHAMMAD MASHIUR RAHMAN RSS

Barrier service restart and dependency injection

MUHAMMAD MASHIUR RAHMAN Newbie

I have a service depends on jboss.ha:service=HASingletonDeployer,type=Barrier

When I stop the Barrier from jmx-console, my service also stopped and destroyed as well.

Then if I start the barrier from jmx-console, the create method of the service is called two times then start method is called but jboss doesn't inject any dependency.

 

   @Resource

    public TimerService timerService;

 

    @Resource

    public SessionContext sessionContext;

 

   

    @PersistenceContext

    public EntityManager mEm;

 

   From service start method I found timerService,mEm, sessionContext everything is null.  Can anyone please help me why this is happening?

 

When I stop the barrier from jmx-console, I get follwing messages in my log 

 

2012-04-12 17:05:27,141 INFO  [STDOUT] (http-0.0.0.0-8080-1) SingletonBarrierService stopped

2012-04-12 17:05:27,150 INFO  [org.jboss.ejb3.EJBContainer] (http-0.0.0.0-8080-1) STOPPED EJB: adactus.diactus.cluster.ejb.service.SingletonBarrierService ejbName: SingletonBarrierService

2012-04-12 17:05:27,151 INFO  [STDOUT] (http-0.0.0.0-8080-1) SingletonBarrierService destroyed

 

 

Then if start again I get the messages below..

 

2012-04-12 16:56:39,174 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1) installing bean: diactus:service=singletonBarrierService

2012-04-12 16:56:39,174 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)   with dependencies:

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)   and demands:

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    jboss.j2ee:ear=clusterTest.ear,jar=clusterTestEJB.jar,name=SingletonBarrierService,service=EJB3

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    jboss.ejb:service=EJBTimerService

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    persistence.unit:unitName=clusterTest.ear/clusterTestEJB.jar#clusterTestEJB

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    jboss.ha:service=HASingletonDeployer,type=Barrier

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)   and supplies:

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    Class:adactus.diactus.cluster.ejb.service.HASingletonServiceRemote

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    Class:adactus.diactus.cluster.timer.StaticEJBTimerOwner

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    jndi:clusterTest/SingletonBarrierService/local-adactus.diactus.cluster.timer.StaticEJBTimerOwner

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    jndi:clusterTest/SingletonBarrierService/remote-adactus.diactus.cluster.ejb.service.HASingletonServiceRemote

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    jndi:clusterTest/SingletonBarrierService/remote

2012-04-12 16:56:39,175 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1)    jndi:clusterTest/SingletonBarrierService/local

2012-04-12 16:56:39,176 INFO  [org.jboss.ejb3.deployers.JBossASKernel] (http-0.0.0.0-8080-1) Installing bean(diactus:service=singletonBarrierService) into kernel

2012-04-12 17:04:48,980 INFO  [org.jboss.ejb3.EJBContainer] (http-0.0.0.0-8080-1) STARTED EJB: adactus.diactus.cluster.ejb.service.SingletonBarrierService ejbName: SingletonBarrierService

2012-04-12 17:04:49,005 INFO  [org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase] (http-0.0.0.0-8080-1) Binding the following Entries in Global JNDI:

 

        clusterTest/SingletonBarrierService/remote - EJB3.x Default Remote Business Interface

        clusterTest/SingletonBarrierService/remote-adactus.diactus.cluster.ejb.service.HASingletonServiceRemote - EJB3.x Remote Business Interface

        clusterTest/SingletonBarrierService/local - EJB3.x Default Local Business Interface

        clusterTest/SingletonBarrierService/local-adactus.diactus.cluster.timer.StaticEJBTimerOwner - EJB3.x Local Business Interface

 

2012-04-12 17:04:49,013 INFO  [STDOUT] (http-0.0.0.0-8080-1) SingletonBarrierService starting

2012-04-12 17:04:49,013 INFO  [STDOUT] (http-0.0.0.0-8080-1) SingletonBarrierService started

 

 

 

But no dependency is being injected.