[jboss-as7-dev] SIP subsystem - How to map JNDI resources

Stuart Douglas stuart.w.douglas at gmail.com
Sat May 12 22:17:01 EDT 2012


To setup JNDI you use 

org.jboss.as.naming.context.NamespaceContextSelector#pushCurrentSelector

The existing setup is done by 

org.jboss.as.ee.naming.JavaNamespaceSetup

Which is attached to the deployment under

org.jboss.as.server.deployment.Attachments#SETUP_ACTIONS

and

org.jboss.as.ee.component.Attachments#WEB_SETUP_ACTIONS

in org.jboss.as.ee.naming.ModuleContextProcessor.

Stuart

On 13/05/2012, at 11:09 AM, JMRecio wrote:

> Hello, experts,
> 
> I started porting Mobicents SIP Servlets framework to AS7, as a 
> subsystem build on top of on top of 7.1.1.Final, taking advantage of the 
> WebContextFactory extension.
> 
> Port is quite functional already, but I am stuck at one point: sip 
> servlets do not have access to java:com and java:app JDNI tree, lookup 
> fails with javax.naming.NameNotFoundException. @Resource mappings work 
> ok though. HTTP Servlets and EJB can access ok to those parts of the 
> JNDI tree.
> 
> Any hint on where/how JNDI access is setup for HTTP servlets 
> deployments? I can take it from there.
> 
> More details below, including pointers to the soure and a test project 
> that shows the behaviour on top of the AS7 release.
> 
> Any help is much appreciated.
> 
> JM
> 
> ---
> 
> Additional details:
> 
> - sip subsystem deployer code:
> 
> http://code.google.com/p/sipservlets/source/browse/containers/sip-servlets-as7-drop-in/jboss-as-mobicents/src/main/java/org/mobicents/as7/deployment
> 
> - test project showcasing the problem in
> http://github.com/josemrecio/test5-as7-sip
> 
> build with mvn clean install and deploy on the pre-packaged Mobicents 
> AS7 release
> 
> start AS7 as:
> 
> $ bin/standalone.sh -c standalone-sip.xml 
> -Djavax.servlet.sip.dar=file:///dev/null
> 
> - Mobicents AS7 release:
> 
> http://sourceforge.net/projects/mobicents/files/Mobicents%20Sip%20Servlets/Mobicents%20Sip%20Servlets%201.7.0.FINAL/mss-1.7.0.FINAL-jboss-as-7.1.1.Final-1334053065.zip/download
> 
> - JNDI dump from a SIP Servlet and a HTTP Servlet in the same war and 
> ear component follows.
> Note that HTTP Servlet has access to the full JNDI tree, but SIP Servlet 
> can't access java:comp or java:app
> 
> Dump Jndi view for SIP Servlet:
> / context:
> \__com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate TransactionManager
> java: context:
> \__com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate TransactionManager
> javax.naming.NameNotFoundException: java:app
> java:global context:
> test5-as7-sip-ear
>   test5-as7-sip-ejb
>     \__com.chema.ejb.PocheteEjbLocal$$$view18 TheEjb
>     \__com.chema.ejb.PocheteEjbLocal$$$view18 
> TheEjb!com.chema.ejb.PocheteEjbLocal
> javax.naming.NameNotFoundException: java:comp
> Done...
> 
> Dump Jndi view for HTTP Servlet:
> / context:
> \__com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate TransactionManager
> java: context:
> \__com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate TransactionManager
> java:app context:
> \__java.lang.String AppName
> \__org.jboss.as.naming.NamingContext env
> sip
>   test5
>     \__org.mobicents.servlet.sip.message.SipFactoryFacade SipFactory
>     \__org.mobicents.servlet.sip.core.session.SipSessionsUtilImpl 
> SipSessionsUtil
>     \__org.mobicents.servlet.sip.core.timers.TimerServiceImpl TimerService
> test5-as7-sip-ejb
>   \__com.chema.ejb.PocheteEjbLocal$$$view6 TheEjb
>   \__com.chema.ejb.PocheteEjbLocal$$$view6 
> TheEjb!com.chema.ejb.PocheteEjbLocal
> java:global context:
> test5-as7-sip-ear
>   test5-as7-sip-ejb
>     \__com.chema.ejb.PocheteEjbLocal$$$view6 TheEjb
>     \__com.chema.ejb.PocheteEjbLocal$$$view6 
> TheEjb!com.chema.ejb.PocheteEjbLocal
> java:app/sip context:
> test5
>   \__org.mobicents.servlet.sip.message.SipFactoryFacade SipFactory
>   \__org.mobicents.servlet.sip.core.session.SipSessionsUtilImpl 
> SipSessionsUtil
>   \__org.mobicents.servlet.sip.core.timers.TimerServiceImpl TimerService
> 
> 
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev




More information about the jboss-as7-dev mailing list