2

I am trying to initial some classes via a SIP-servlet. For that I am using a sip.xml for my mss-2.0.0.FINAL-jboss-as-7.1.2 server.

Sip.xml:

<?xml version="1.0" encoding="UTF-8"?>  
    <sip-app xmlns="http://www.jcp.org/xml/ns/sipservlet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
      xsi:schemaLocation="http://www.jcp.org/xml/ns/sipservlet" xmlns:javaee="http://java.sun.com/xml/ns/javaee"  
      xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1">  


      <app-name>service.ngsi.multimediaconference</app-name>  


      <servlet-selection>  
      <servlet-mapping>  
      <servlet-name>multimedia-conference</servlet-name>  
      <pattern>  
      <equal>  
      <var>request.method</var>  
      <value>INVITE</value>  
      </equal>  
      </pattern>  
      </servlet-mapping>  
      </servlet-selection>  


      <servlet>  
      <servlet-name>multimedia-conference</servlet-name>  
      <servlet-class>com.abc.multimediaconference.ServletSipMultimediaConference</servlet-class>  
      <load-on-startup>1</load-on-startup>  
      </servlet>  


      <session-config>  
      <session-timeout>120</session-timeout>  
      </session-config>  
    </sip-app>  

My logs:

16:11:03,896 INFO  [org.jboss.modules] JBoss Modules version 1.1.2.GA  
16:11:04,903 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA  
16:11:04,989 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.2.Final "Steropes" starting  
16:11:09,072 INFO  [org.jboss.as.server.deployment.scanner] JBAS01 5003: Found Conference.war in deployment directory. To trigger deployment create a file called Conference.war.dodeploy   
16:11:09,073 INFO  [org.jboss.as.server.deployment.scanner] JBAS015003: Found my-sipapp.war in deployment directory. To trigger deployment create a file called my-sipapp.war.dodeploy  
16:11:09,134 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)  
16:11:09,157 INFO  [org.xnio] XNIO Version 3.0.3.GA   
16:11:09,198 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA  
16:11:09,207 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.7.GA  
16:11:09,263 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers  
16:11:09,270 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 27) JBAS016200: Activating ConfigAdmin Subsystem  
16:11:09,283 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 39) JBAS011800: Activating Naming Subsystem  
16:11:09,294 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 40) JBAS011906: Activating OSGi Subsystem  
16:11:09,305 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013101: Activating Security Subsystem  
16:11:09,361 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.  
16:11:09,388 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 50) JBAS015537: Activating WebServices Extension  
16:11:09,472 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-4) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.11.Final)  
16:11:09,615 INFO  [org.jboss.as.security] (MSC service thread 1-5) JBAS013100: Current PicketBox version=4.0.9.Final  
16:11:10,532 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3) 16:11:10,567 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service  
16:11:10,571 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]   
16:11:11,137 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-5) Starting Coyote HTTP/1.1 on `http-localhost/127.0.0.1:8080`   
16:11:11,217 INFO  [org.mobicents.servlet.sip.catalina.SipStandardService] (MSC service thread 1-7) Pretty encoding of headers enabled ? true  
16:11:11,218 INFO  [org.mobicents.servlet.sip.catalina.SipStandardService] (MSC service thread 1-7) Sip Stack path name : gov.nist  
16:11:11,397 INFO  [org.mobicents.servlet.sip.catalina.SipStandardService] (MSC service thread 1-7) Mobicents Sip Servlets sip stack properties :   
{gov.nist.javax.sip.DEBUG_LOG=/opt/mss-2.0.0.FINAL-jboss-as-7.1.2.Final/standalone/tmp/logs/mss-jsip-debuglog.txt,   
gov.nist.javax.sip.PASS_INVITE_NON_2XX_ACK_TO_LISTENER=true,   
gov.nist.javax.sip.MAX_LISTENER_RESPONSE_TIME=120,   
gov.nist.javax.sip.LOG4J_LOGGER_NAME=gov.nist,   
javax.sip.AUTOMATIC_DIALOG_SUPPORT=off,   
gov.nist.javax.sip.SERVER_LOG=/opt/mss-2.0.0.FINAL-jboss-as-7.1.2.Final/standalone/tmp/logs/mss-jsip-messages.xml,   
gov.nist.javax.sip.REENTRANT_LISTENER=true,   
gov.nist.javax.sip.MAX_FORK_TIME_SECONDS=0,  
org.mobicents.ha.javax.sip.REPLICATE_APPLICATION_DATA=false,  
gov.nist.javax.sip.RECEIVE_UDP_BUFFER_SIZE=65536,  
javax.sip.STACK_NAME=Mobicents-SIP-Servlets,  
gov.nist.javax.sip.TCP_POST_PARSING_THREAD_POOL_SIZE=30,  
gov.nist.javax.sip.LOOSE_DIALOG_VALIDATION=true,  
org.mobicents.ha.javax.sip.REPLICATION_STRATEGY=ConfirmedDialog,  
gov.nist.javax.sip.AGGRESSIVE_CLEANUP=true,  
gov.nist.javax.sip.TRACE_LEVEL=LOG4J,  
gov.nist.javax.sip.MAX_MESSAGE_SIZE=10000,  
gov.nist.javax.sip.AUTOMATIC_DIALOG_ERROR_HANDLING=false,  
gov.nist.javax.sip.SEND_UDP_BUFFER_SIZE=65536,  
gov.nist.javax.sip.LOG_MESSAGE_CONTENT=true,  
gov.nist.javax.sip.THREAD_POOL_SIZE=64,  
gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY=true,  
javax.sip.ROUTER_PATH=org.mobicents.ext.javax.sip.dns.DNSAwareRouter}  
16:11:11,576 INFO  [gov.nist.javax.sip.stack.SIPTransactionStack] (MSC service thread 1-7) value -1000 will be used for reliableConnectionKeepAliveTimeout stack property   
16:11:11,576 INFO  [gov.nist.javax.sip.stack.SIPTransactionStack] (MSC service thread 1-7) Setting Stack Thread priority to 10   
16:11:11,579 WARN  [gov.nist.javax.sip.SipStackImpl] (MSC service thread 1-7) using default tls security policy  
16:11:11,641 INFO  [gov.nist.javax.sip.stack.timers.DefaultSipTimer] (MSC service thread 1-7) the sip stack timer gov.nist.javax.sip.stack.timers.DefaultSipTimer has been started  
16:11:11,642 INFO  [org.mobicents.servlet.sip.catalina.SipStandardService] (MSC service thread 1-7) no AddressResolver will be used since none has been specified.  
16:11:11,642 INFO  [org.mobicents.servlet.sip.catalina.SipStandardService] (MSC service thread 1-7) SIP stack initialized  
16:11:11,643 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) SIP Base Timer Interval set to 500ms  
16:11:11,643 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) SIP Timer T2 Interval set to 4000ms  
16:11:11,643 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) SIP Timer T4 Interval set to 5000ms  
16:11:11,643 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) SIP Timer D Interval set to 32000ms  
16:11:11,643 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Memory threshold set to 85%  
16:11:11,644 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Back To Normal Memory threshold set to 75%  
16:11:11,644 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Congestion Control policy set to ErrorResponse  
16:11:11,644 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Queue Size set to 1500  
16:11:11,644 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Back To Normal Queue Size set to 1300  
16:11:11,644 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Gathering Statistics set to true  
16:11:11,645 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Container wide Concurrency Control set to SipApplicationSession   
16:11:11,645 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Bypass Request Executor enabled ?true  
16:11:11,645 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Bypass Response Executor enabled ?true  
16:11:11,645 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Using the Service Provider Framework to load the application router provider  
16:11:11,652 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]  
16:11:11,654 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl@4da19f89 Using the following Application Router instance: org.mobicents.servlet.sip.router.DefaultApplicationRouter@2df10330  
16:11:11,697 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) Sip Application dispatcher registered under following name jboss.sip:type=SipApplicationDispatcher   
16:11:11,697 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) bypassRequestExecutor ? true   
16:11:11,698 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) bypassResponseExecutor ? true  
16:11:11,707 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) AsynchronousThreadPoolExecutor size is 15  
16:11:11,709 INFO  [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (MSC service thread 1-7) No Congestion control background task started since the checking interval is equals to -1 milliseconds.  
16:11:11,710 INFO  [org.mobicents.servlet.sip.core.Version] (MSC service thread 1-7) Release ID: (Mobicents) Sip Servlets 2.0.0.FINAL (build: Git Hash=r031dc15b05f0bbe5d5e3a9af6a2fb0e2560d9426 date=201210011610)  
16:11:11,711 INFO  [org.mobicents.servlet.sip.core.Version] (MSC service thread 1-7) Mobicents Sip Servlets 2.0.0.FINAL (build: Git Hash=r031dc15b05f0bbe5d5e3a9af6a2fb0e2560d9426 date=201210011610) Started.  
16:11:11,711 INFO  [org.mobicents.servlet.sip.core.Version] (MSC service thread 1-7) Thank you for running Mobicents Community code. For Commercial Grade Support, please purchase a Telscale subscription from http://www.telestax.com  
16:11:11,969 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-3) JBoss Web Services - Stack CXF Server 4.0.2.GA  
16:11:12,162 INFO  [org.mobicents.servlet.sip.catalina.SipProtocolHandler] (MSC service thread 1-4) Sip Connector started on ip address: localhost, port 5081, transport tls, useStun false, stunAddress null, stunPort : -1, useStaticAddress: false, staticServerAddress null, staticServerPort -1  
16:11:12,162 INFO  [org.mobicents.servlet.sip.catalina.SipProtocolHandler] (MSC service thread 1-6) Sip Connector started on ip address: localhost, port 5080, transport tcp, useStun false, stunAddress null, stunPort : -1, useStaticAddress: false, staticServerAddress null, staticServerPort -1  
16:11:12,514 INFO  [org.mobicents.servlet.sip.catalina.SipProtocolHandler] (MSC service thread 1-8) Sip Connector started on ip address: localhost, port 5080, transport udp, useStun false, stunAddress null, stunPort : -1, useStaticAddress: false, staticServerAddress null, staticServerPort -1  
16:11:12,523 INFO  [org.mobicents.servlet.sip.catalina.SipProtocolHandler] (MSC service thread 1-7) Sip Connector started on ip address: localhost, port 5082, transport ws, useStun false, stunAddress null, stunPort : -1, useStaticAddress: false, staticServerAddress null, staticServerPort -1  
16:11:12,614 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory /opt/mss-2.0.0.FINAL-jboss-as-7.1.2.Final/standalone/deployments  
16:11:12,630 INFO  [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on `127.0.0.1:9999`  
16:11:12,657 INFO  [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on `127.0.0.1:4447`  
16:11:12,753 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "Conference.war"  
16:11:14,165 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015960: Class Path entry xercesImpl.jar in /opt/mss-2.0.0.FINAL-jboss-as-7.1.2.Final/standalone/deployments/Conference.war/WEB-INF/lib/xalan-2.7.0.jar does not point to a valid jar for a Class-Path reference.  
16:11:14,166 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015960: Class Path entry xml-apis.jar in /opt/mss-2.0.0.FINAL-jboss-as-7.1.2.Final/standalone/deployments/Conference.war/WEB-INF/lib/xalan-2.7.0.jar does not point to a valid jar for a Class-Path reference.  
16:11:14,167 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015960: Class Path entry serializer.jar in /opt/mss-2.0.0.FINAL-jboss-as-7.1.2.Final/standalone/deployments/Conference.war/WEB-INF/lib/xalan-2.7.0.jar does not point to a valid jar for a Class-Path reference.   
16:11:14,934 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)  
16:11:14,976 INFO  [org.jboss.as.osgi] (MSC service thread 1-2) JBAS011907: Register module: Module "deployment.Conference.war:main" from Service Module Loader   
16:11:15,113 INFO  [org.jboss.web] (MSC service thread 1-7) JBAS018210: Registering web context: /Conference  
16:11:15,128 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "Conference.war"  
16:11:15,329 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on `http://127.0.0.1:9990`  
16:11:15,330 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.2.Final "Steropes" started in 12503ms - Started 182 of 270 services (87 services are passive or on-demand)

After that my module can be used and also the REST communication works but all variables/ object which should be initial via servlet on startup are null.

Someone an idea?

Grimbo
  • 237
  • 2
  • 13
  • Look at http://stackoverflow.com/questions/809775/what-does-the-servlet-load-on-startup-value-of-0-zero-signify – Kennet Sep 30 '13 at 09:25
  • Thanks but that doesn't help me much. It doens't matter if I am using a 0 or a positive Integer. The servlet isn't initialized at start up at all. – Grimbo Oct 01 '13 at 13:44
  • Please share the code of the application and DEBUG logs when the SIP or HTTP calls are made as it is hard to identify what has gone wrong from the information you posetd – jeand Oct 01 '13 at 14:01

4 Answers4

0

The SipServlet primary initialize some objects.

ServletSipMultimediaConfrence.java:

    @javax.servlet.sip.annotation.SipServlet
public class ServletSipMultimediaConference extends SipServlet {
    ...
    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        ctx = config.getServletContext();

        System.out.println("Init SIP Servlet!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");

        SipFactory sipFactory = (SipFactory) getServletContext().getAttribute(
                SipServlet.SIP_FACTORY);
        if (sipFactory == null) {
            getServletContext().log("SIP Factory is null");
        } else {
            getServletContext().log("SIP Factory set.");
        }
        ContextManager.getInstance().setSipFactory(sipFactory);

        getServletContext().log("SipServlet MultimediaConference initialized.");

        configureThirdPartyCallModule();
    }
...
}

If I try to invite a participant to a conference I got a NullPointerException cause my SipFactory is null!

MultimediaConferenceImpl.java:

@POST
@Path("/inviteParticipant")
@Override
public void inviteParticipant(@QueryParam("sessionId") String sessionId,
        @QueryParam("callSessionIdentifier") String callSessionIdentifier,
        @QueryParam("participant") String participant) throws PolicyException,
        ServiceException {

    CallSessionConference conferenceSession = getConferenceSession(null,
            callSessionIdentifier);
    if (conferenceSession == null)
        throw new ServiceException("No conference found using id: "
                + callSessionIdentifier);

    conferenceSession.inviteParticipant(participant);
}

This leads to following exception:

Servlet.service() for servlet de.fhg.fokus.ngni.broker.sip.multimediaconference.JaxRsActivator threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
    at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:340) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:540) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.3.Final.jar:]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.1.Final.jar:1.0.1.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.16.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.16.Final.jar:]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.16.Final.jar:]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.16.Final.jar:]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.2.Final.jar:7.1.2.Final]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.16.Final.jar:]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.16.Final.jar:]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.16.Final.jar:]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.16.Final.jar:]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.16.Final.jar:]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679) [jbossweb-7.0.16.Final.jar:]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931) [jbossweb-7.0.16.Final.jar:]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: java.lang.NullPointerException
    at de.fhg.fokus.ngni.broker.sip.thirdpartycall.Call.<init>(Call.java:100) [classes:]
    at de.fhg.fokus.ngni.broker.sip.thirdpartycall.CallSessionThirdParty.createCallee(CallSessionThirdParty.java:141) [classes:]
    at de.fhg.fokus.ngni.broker.sip.thirdpartycall.CallSessionThirdParty.<init>(CallSessionThirdParty.java:104) [classes:]
    at de.fhg.fokus.ngni.broker.sip.multimediaconference.CallSessionConference.inviteParticipant(CallSessionConference.java:96) [classes:]
    at de.fhg.fokus.ngni.broker.sip.multimediaconference.MultimediaConferenceImpl.inviteParticipant(MultimediaConferenceImpl.java:242) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_25]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_25]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_25]
    at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_25]
    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.3.Final.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.3.Final.jar:]
    ... 19 more

This happens cause my SipFactory is null when Call.java try to get it from servlet-context.

static {
        factory = ContextManager.getInstance().getSipFactory();
    }

ContextManager is a helper class:

public class ContextManager {

    private SipFactory factory;
//  private BundleContext bundleContext;

    private static ContextManager cm = new ContextManager();

    public static ContextManager getInstance() {
        return cm;
    }

    public SipFactory getSipFactory() {
        return factory;
    }

    public void setSipFactory(SipFactory factory) {
        this.factory = factory;
    }
}

My full log on DEBUG level here: https://community.jboss.org/thread/232864

Grimbo
  • 237
  • 2
  • 13
0

You say the problem is that SipFactory is null. But the code you posted never initializes the SipFactory. Look at ServletSipMultimediaConference.init() method. You just check if the SipFactory is null, but you do not initialize it:

public class ServletSipMultimediaConference extends SipServlet {
...
@Override
public void init(ServletConfig config) throws ServletException {
    ...
    SipFactory sipFactory = (SipFactory)getServletContext()
        .getAttribute(SipServlet.SIP_FACTORY);
    if (sipFactory == null) {
        getServletContext().log("SIP Factory is null");
        //  -->  Maybe set up a new SIP Factory here?!  <--
    } else {
        getServletContext().log("SIP Factory set.");
    }
    ContextManager.getInstance().setSipFactory(sipFactory);
    ...
}
}
David
  • 1,204
  • 12
  • 16
  • The servlet and some "magic" behind that set up the Factory. My problem is, that the init() mehtod is never triggered. I can't reach it via debugging & breakpoint or even SYSOs or logs never will appear somewhere. This question aims to find out why my servlet isn't triggered at deployment! – Grimbo Oct 03 '13 at 17:46
0

Can you provide DEBUG logs for org.mobicents category as well ? It seems your init method is not even called.

I see that the SIP Servlet is defined both in sip.xml and as an annotation, the annotation may take precedence here did you try to add loadOnStartup=1 to the @javax.servlet.sip.annotation.SipServlet annotation ?

the init method logging statement should be displayed in the logs on startup when the application is deployed

jeand
  • 2,325
  • 14
  • 12
  • Yeah the init method is never called and I can't figure out why. I am not sure what do u want with "provide DEBUG logs for org.mobicents category". I also tried loadOnStartup=0, same result. And how can I add loadOnStartup to the annotation? – Grimbo Oct 03 '13 at 15:52
  • @javax.servlet.sip.annotation.SipServlet(loadOnStartup=1) – jeand Oct 04 '13 at 07:10
  • I tried only annotation(loadOnStartup) w/o sip.xml. Also sip.xml w/o annotation and both. Nothing worked! Still init() of servlet isn't called at deployment. – Grimbo Oct 07 '13 at 13:31
  • Please open an issue at https://code.google.com/p/sipservlets/issues/entry and attach an application that reproduces your problem so we can look into it – jeand Oct 14 '13 at 08:44
0

I found the problem. It was a maven/ a pom.xml failure! I forget to put into my maven plugin-config following entry: <warSourceDirectory>WebContent</warSourceDirectory>

<plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.2</version>
    <configuration>
        <warSourceDirectory>WebContent</warSourceDirectory>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
</plugin>
Grimbo
  • 237
  • 2
  • 13