[jboss-user] [JNDI and Naming] - Not working injection with Service

Marco Col do-not-reply at jboss.com
Mon Jun 11 04:48:47 EDT 2012


Marco Col [https://community.jboss.org/people/lanrjtokenring] created the discussion

"Not working injection with Service"

To view the discussion, visit: https://community.jboss.org/message/740924#740924

--------------------------------------------------------------
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
[https://community.jboss.org/message/740924#740924]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120611/f8010cb4/attachment.html 


More information about the jboss-user mailing list