Topic
  • 4 replies
  • Latest Post - ‏2011-02-18T20:11:06Z by bkail
SystemAdmin
SystemAdmin
45 Posts

Pinned topic Injecting SipFactory into EJB

‏2011-02-18T15:36:00Z |
Hi, I'm having a problem injecting SipFactory into a EJB. Right now the code I've tried is


@Stateless @LocalBean 

public 

class CallerBean 

implements CallerBeanRemote, CallerBeanLocal 
{ @Resource(name=
"sip/Click2Call_sip_router/SipFactory") SipFactory sf;   

public CallerBean() 
{ 

if (sf == 

null)
{ System.out.println(
"SipFactory injection failed !" + sf); 
}

else
{ System.out.println(
"SipFactory injection worked yay!"); 
} 
}

Every time I call the bean from my http servlet I get the failure message. Inside of the project with the sip.xml the sip-app name is Click2Call_sip_router. I imagine its a problem with the way I'm naming the resource, but I can't find any documentation on how it should be named. The set up of the ear is that there is a ejb project, a dynamic web project and a sip project. I'm trying to call the Sipfactory from the sip project.

Any ideas?

Thanks,
Bryan
Updated on 2011-02-18T20:11:06Z at 2011-02-18T20:11:06Z by bkail
  • SystemAdmin
    SystemAdmin
    45 Posts

    Re: Injecting SipFactory into EJB

    ‏2011-02-18T16:44:27Z  
    Hi Bryan,

    Are there any CWNEN* or naming messages in the SystemOut.log that indicate the JNDI name of the Resource.
    Another option is to use the dumpNameSpace tool to look at all the Resources registered with JNDI.
    Do the FFDC logs provide any clue ?

    --Thanks,
    Rohit
  • SystemAdmin
    SystemAdmin
    45 Posts

    Re: Injecting SipFactory into EJB

    ‏2011-02-18T18:58:38Z  
    Hi Bryan,

    Are there any CWNEN* or naming messages in the SystemOut.log that indicate the JNDI name of the Resource.
    Another option is to use the dumpNameSpace tool to look at all the Resources registered with JNDI.
    Do the FFDC logs provide any clue ?

    --Thanks,
    Rohit
    I'm unable to find any sip/*/SipFactory mentioned in any of the logs. When I run dumpNameSpace.sh I don't get anything that looks useful. I tried following an example to dump the java: using wsadmin, and was not succesful.

    I also tried using the UTC, but it loads up a different application servers namespace (I have multiple instances on one machine running). I need to put the bootstrap port when I run dumpNameSpace.sh.

    Thanks,
    Bryan
  • SystemAdmin
    SystemAdmin
    45 Posts

    Re: Injecting SipFactory into EJB

    ‏2011-02-18T19:21:45Z  
    I'm unable to find any sip/*/SipFactory mentioned in any of the logs. When I run dumpNameSpace.sh I don't get anything that looks useful. I tried following an example to dump the java: using wsadmin, and was not succesful.

    I also tried using the UTC, but it loads up a different application servers namespace (I have multiple instances on one machine running). I need to put the bootstrap port when I run dumpNameSpace.sh.

    Thanks,
    Bryan
    Got it working. Needed to make it look like this in my injection

    @Resource(name="java:comp/env/sip/Click2Call_sip_router/SipFactory") SipFactory sf;

    Thanks,
    Bryan
  • bkail
    bkail
    1 Post

    Re: Injecting SipFactory into EJB

    ‏2011-02-18T20:11:06Z  
    Got it working. Needed to make it look like this in my injection

    @Resource(name="java:comp/env/sip/Click2Call_sip_router/SipFactory") SipFactory sf;

    Thanks,
    Bryan
    Those two @Resource annotations should be identical. Can you create failing/working standalone applications that demonstrate the problem? If so, I can open an internal defect against the SIP container to have this problem investigated.