Hi guys,
I'm having some problems with Mobicents and spring... and maybe you guys can help me.
Ok here is the problem:
I'm integrating Kurento Media Server (i need video support, and MMS still does not have video support) with my Mobicents AS, and i need some "bean injection" in order to get access to their api.
I know this is not a direct problem of Mobicents, but maybe you guys can help me with Spring
If i do this in a standalone project, it works fine:
final ClassPathXmlApplicationContext mediaContext = new ClassPathXmlApplicationContext("kmf-media-config.xml");
MediaPipelineFactory mediaPipelineFactory = mediaContext.getBean(MediaPipelineFactory.class);
but when i run it inside an SBB, like as follows:
public void setSbbContext(SbbContext context) {
this.sbbContext = (SbbContextExt) context;
if(tracer==null)
{
tracer = sbbContext.getTracer(KurentoSbb.class.getSimpleName());
}
try {
final Context ctx = (Context) new InitialContext().lookup("java:comp/env");
sipActivityContextInterfaceFactory = (SipActivityContextInterfaceFactory) ctx.lookup("slee/resources/jainsip/1.2/acifactory");
sipProvider = (SleeSipProvider) ctx.lookup("slee/resources/jainsip/1.2/provider");
headerFactory = sipProvider.getHeaderFactory();
messageFactory = sipProvider.getMessageFactory();
addressFactory = sipProvider.getAddressFactory();
final ClassPathXmlApplicationContext mediaContext = new ClassPathXmlApplicationContext("kmf-media-config.xml");
mediaPipelineFactory = mediaContext.getBean(MediaPipelineFactory.class);;
} catch (Throwable e) {
tracer.severe(e.getMessage());
}
}
i got the following error:
2014-03-28 14:33:49,701 ERROR [javax.slee.SbbNotification[service=ServiceID[name=adverstisement-service,vendor=org.wit.software,version=1.0],sbb=SbbID[name=KurentoSbb,vendor=org.wit.software,version=1.0]].KurentoSbb] (Timer-24) deu erro
javax.naming.NameNotFoundException: resources not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at org.wit.software.KurentoSbb.setSbbContext(KurentoSbb.java:57)
at org.mobicents.slee.runtime.sbb.SbbObjectImpl.<init>(SbbObjectImpl.java:124)
at org.mobicents.slee.runtime.sbb.SbbObjectPoolFactory.makeObject(SbbObjectPoolFactory.java:146)
at org.apache.commons.pool.impl.GenericObjectPool.addObject(GenericObjectPool.java:1276)
at org.apache.commons.pool.impl.GenericObjectPool.ensureMinIdle(GenericObjectPool.java:1254)
at org.apache.commons.pool.impl.GenericObjectPool.access$100(GenericObjectPool.java:179)
at org.apache.commons.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1346)
at java.util.TimerThread.mainLoop(Timer.java:534)
at java.util.TimerThread.run(Timer.java:484)
I have all the dependencies in the pom file... Not really sure what I'm doing wrong.
Cheers,
David