JBoss Community

Not working injection with Service

created by Marco Col in JNDI and Naming - View the full discussion

Hi all,

I have this problem and I cannot get rid ot it!

 

I have a JBoss service like this:

 

 


@Service()
@Local(MyServLocal.class)
@Remote(MyServRemote.class)
@Management(MyServRemoteManagement.class)
@Depends("jboss.ha:service=HASingletonDeployer,type=Barrier")
@Clustered
public class MyService 
          implements MyServLocal,MyServRemote {
  
          @Resource(mappedName="activemq/TopicConnectionFactory")
          private TopicConnectionFactory tConnFactory;
          @Resource(mappedName="topic/CTOST")
          private Topic ctostopic;
  
          public void create(){
                    if(tConnFactory!=null){
                              System.out.println("[Start] Scheduler started");
                    } else {
                              System.out.println("[Start] Failed");
                    }
          }


          public void start() {
                    this.create();
          }

 

 

Either tConnFactory and ctostopic are null. By the way I can see the resources in JNDIView and, if I call after JBoss startup a EJB injecting the same resources, references are correctly injected.

 

Can anybode help on this? Any idea?

 

This is with JBoss 5.1, but also with 6.

 

Regards

Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community