JSLEE Discussions
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
createApplicationSession() in init() fails with load-on-startup
Forum Index » Rhino SIP Servlet
Author Message
xsxs3434


Joined: 27/08/2015 00:01:39
Messages: 3
Offline

Hi!

I am getting javax.slee.resource.StartActivityException when trying to call SipFactory.createApplicationSession() from the init() function of my SIP servlet.
This only happens when load-on-startup is specified.

What is causing this? A bug in the SipServlet RA or something else?
AFAIK there are no restrictions on when createApplicationSession() can be called, so calling it from init() should be ok. Or am I missing something?

Regards,
Jan Wedvik

How to reproduce:

Patch the RhinoSDK/sipservlet-1.1.0.1/examples/sipservlet-services servlet as follows:

--- /home/jwedvik/RhinoSDK/sipservlet-1.1.0.1/examples/sipservlet-services/resources/WEB-INF/sip.xml 2014-09-20 03:17:20.000000000 +0200
+++ resources/WEB-INF/sip.xml 2015-12-15 13:37:36.406672000 +0100
@@ -81,7 +81,7 @@
<servlet>
<servlet-name>registrar-servlet</servlet-name>
<servlet-class>com.opencloud.sipservlet.registrar.RegistrarServlet</servlet-class>
- <load-on-startup/>
+ <load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>proxy-servlet</servlet-name>
@@ -152,7 +152,7 @@
<jee:env-entry>
<jee:env-entry-name>expiryTimeNonCompliant</jee:env-entry-name>
<jee:env-entry-type>java.lang.String</jee:env-entry-type>
- <jee:env-entry-value></jee:env-entry-value>
+ <jee:env-entry-value>dummy</jee:env-entry-value>
</jee:env-entry>

<resource-ref>
--- /home/jwedvik/RhinoSDK/sipservlet-1.1.0.1/examples/sipservlet-services/src/com/opencloud/sipservlet/registrar/RegistrarServlet.java 2014-09-20 03:17:20.000000000 +0200
+++ src/com/opencloud/sipservlet/registrar/RegistrarServlet.java 2015-12-15 13:35:21.285736400 +0100
@@ -43,7 +43,9 @@

@Override
public void init() throws ServletException {
+ sipFactory.createApplicationSession();
locationService = (LocationService) getServletContext().getAttribute(LocationService.class.getName());
+ log.error("RegistrarServlet.init() succeeded.");
}

@Override
--- end of patch ---

Build and deploy the servlet. Check the log to see the following error:

2015-12-15 13:38:29.400 Warning [trace.sipservlet_services_1_0] <GroupRMI-thread-11> [sipservle
t-services/sipservlet-services] Container initialization/startup failed
java.lang.RuntimeException: javax.slee.resource.StartActivityException: service is inactive: Servi
ceID[name=sipservlet-services,vendor=OpenCloud,version=1.0]
at com.google.common.base.Throwables.propagate(Throwables.java:160)
at com.opencloud.sipservlet.server.SipFactoryImpl.createApplicationSession(SipFactoryImpl.
java:142)
at com.opencloud.slee.resources.framework.guice.PrivilegedModule$Interceptor$1.run(Privile
gedModule.java:35)
at java.security.AccessController.doPrivileged(Native Method)
at com.opencloud.slee.resources.framework.guice.PrivilegedModule$Interceptor.invoke(Privil
egedModule.java:31)
at com.opencloud.slee.resources.framework.guice.Utils$1.call(Utils.java:13)
at com.opencloud.slee.resources.framework.guice.Utils$2.call(Utils.java:22)
at com.opencloud.slee.resources.framework.tx.TransactionExecutor$Action.call(TransactionEx
ecutor.java:183)
at com.opencloud.slee.resources.framework.tx.TransactionExecutor.executeSynchronous(Transa
ctionExecutor.java:97)
at com.opencloud.slee.resources.framework.guice.SleeTransactionModule$SleeTransactionInter
ceptor.doInTransaction(SleeTransactionModule.java:55)
at com.opencloud.slee.resources.framework.guice.SleeTransactionModule$SleeTransactionInter
ceptor.invoke(SleeTransactionModule.java:43)
at com.opencloud.sipservlet.server.SSExtensionProviderImpl.createSipApplicationSessionForI
nvokingService(SSExtensionProviderImpl.java:212)
at com.opencloud.rhino.deployed.ratype.OpenCloud.sipservlet_extension_1_1.ResourceAdaptorI
nterfaceProxy.createSipApplicationSessionForInvokingService(ResourceAdaptorInterfaceProxy.java:62)
at com.opencloud.sipservlet.wrapper.impl.SleeEnvironmentImpl.createSipApplicationSessionFo
rInvokingService(SleeEnvironmentImpl.java:195)
at com.opencloud.sipservlet.container.runtime.wrapper.SpyingSipFactory.createApplicationSe
ssion(SpyingSipFactory.java:37)
at com.opencloud.sipservlet.registrar.RegistrarServlet.init(Unknown Source)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at com.opencloud.sipservlet.container.runtime.handler.ServletHandler$3.call(ServletHandler.java:362)
at com.opencloud.sipservlet.container.runtime.handler.ServletHandler$3.call(ServletHandler.java:359)
at com.opencloud.sipservlet.wrapper.impl.SleeEnvironmentImpl$2.run(SleeEnvironmentImpl.java:125)
at java.security.AccessController.doPrivileged(Native Method)
at com.opencloud.sipservlet.wrapper.impl.SleeEnvironmentImpl.doPrivilegedInSarContext(SleeEnvironmentImpl.java:122)
at com.opencloud.sipservlet.container.runtime.SipContainerImpl$1.doPrivilegedInSarContext(
SipContainerImpl.java:174)
at com.opencloud.sipservlet.container.runtime.ContainerEnvironmentWrapper.doPrivilegedInSa
rContext(ContainerEnvironmentWrapper.java:150)
at com.opencloud.sipservlet.container.runtime.handler.ServletHandler.initializeServlet(Ser
vletHandler.java:359)
at com.opencloud.sipservlet.container.runtime.handler.ServletHandler.startup(ServletHandler.java:99)
at com.opencloud.sipservlet.container.runtime.ServletContainer.startup(ServletContainer.java:104)
at com.opencloud.sipservlet.container.runtime.SipContainerImpl.doStartup(SipContainerImpl.java:526)
at com.opencloud.sipservlet.container.runtime.ThreadSafeContainer$2.run(ThreadSafeContainer.java:131)
at com.opencloud.sipservlet.container.runtime.ThreadSafeContainer$2.run(ThreadSafeContainer.java:127)
at java.security.AccessController.doPrivileged(Native Method)
at com.opencloud.sipservlet.container.runtime.ThreadSafeContainer.startup(ThreadSafeContainer.java:127)
at com.opencloud.sipservlet.wrapper.impl.SipServletSbbImpl.initContainer(SipServletSbbImpl.java:110)
at com.opencloud.sipservlet.wrapper.impl.SipServletSbbImpl.addRef(SipServletSbbImpl.java:71)
at com.opencloud.sipservlet.wrapper.impl.SipServletSbbImpl.setSbbContext(SipServletSbbImpl.java:55)
at com.opencloud.rhino.deployed.sbb.OpenCloud.sipservlet_services_1_0.SbbOCBBBean.setOCBBContext(SbbOCBBBean.java:28)
at com.opencloud.deployed.Service_sipservlet_services_OpenCloud_1_0_7.SBB_sipservlet_services_OpenCloud_1_0OCBB_Bean.ocbbRhinoSetOCBBContext(SBB_sipservlet_services_OpenCloud_1_0OCBB_Bean.java:255)
at com.opencloud.ob.RhinoSDK.cf.a(2.3-1.16-78356:106)
at com.opencloud.ob.RhinoSDK.un.initializeObjectPools(2.3-1.16-78356:121)
at com.opencloud.ob.RhinoSDK.zm.a(2.3-1.16-78356:49)
at com.opencloud.ob.RhinoSDK.iH.a(2.3-1.16-78356:103)
at com.opencloud.rhino.node.state.ServiceStateImpl.servicesActivated(2.3-1.16-78356:12)
at com.opencloud.rhino.node.state.ServiceStateImpl__OCSkel.b(2.3-1.16-78356:51)
at com.opencloud.rhino.node.state.ServiceStateImpl__OCSkel.invoke(2.3-1.16-78356:11)
at com.opencloud.ob.RhinoSDK.aj.a(2.3-1.16-78356:208)
at com.opencloud.ob.RhinoSDK.aj.a(2.3-1.16-78356:24)
at com.opencloud.ob.RhinoSDK.aj$b.run(2.3-1.16-78356:180)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.slee.resource.StartActivityException: service is inactive: ServiceID[name=sipservlet-services,vendor=OpenCloud,version=1.0]
at com.opencloud.sipservlet.server.Activities.createApplicationSession(Activities.java:113)
at com.opencloud.sipservlet.server.Activities.getApplicationSession(Activities.java:96)
at com.opencloud.sipservlet.server.SipFactoryImpl.createApplicationSession(SipFactoryImpl.java:140)
... 48 more


Environment
Rhino version:
2015-12-15 10:31:30.264 INFO [root] <main> Rhino-SDK (version='2.3', release='1.16', build='201403271625', revision='78356'): log file started

java -version
java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

Sipservlet-version: 1.1.0.1

uname -a
Linux host.domain.com 3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Sep 15 15:05:51 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
ben


Joined: 27/02/2008 13:51:28
Messages: 144
Location: NZ
Offline

Hi Jan, this looks like a bug in our implementation, not anything you're doing wrong. We will need to fix this in an update.

Ben Evans, Software Engineer, OpenCloud
[WWW]
 
Forum Index » Rhino SIP Servlet
Go to:   
Powered by JForum 2.1.8 © JForum Team