[mobicents-public] Exception while running the Player servlet example of jsr309

56 views
Skip to first unread message

Amit

unread,
Jun 18, 2009, 9:30:16 AM6/18/09
to mobicents-public
I have install the standalone media server on 192.168.10.32 IP and
application is deployed on the 192.168.10.240 IP.

when i am running the application I am getting this Exception.

Servlet 'PromptAndCollectServlet' threw an exception during
initialization.
java.lang.RuntimeException: Failed to find a local port to bound stack



I have also checked the application after changing this in the code
protected static final String PEER_ADDRESS = System.getProperty
("jboss.bind.address", "192.168.10.32");

but exception is same.

Pls tell me what I have to change or configure in code to run the
application.


Eception-----
Servlet 'PromptAndCollectServlet' threw an exception during
initialization.
java.lang.RuntimeException: Failed to find a local port to bound stack
at org.mobicents.mgcp.stack.JainMgcpStackImpl.init
(JainMgcpStackImpl.java:154)
at org.mobicents.mgcp.stack.JainMgcpStackImpl.createProvider
(JainMgcpStackImpl.java:279)
at
org.mobicents.jsr309.mgcp.MgcpStackFactory.getMgcpStackProvider
(MgcpStackFactory.java:81)
at
org.mobicents.javax.media.mscontrol.MsControlFactoryImpl.<init>
(MsControlFactoryImpl.java:32)
at
org.mobicents.javax.media.mscontrol.spi.DriverImpl.getFactory
(DriverImpl.java:25)
at org.mobicents.servlet.sip.example.PlayerServlet.init
(PlayerServlet.java:119)
at
org.mobicents.servlet.sip.example.PromptAndCollectServlet.init
(PromptAndCollectServlet.java:78)
at com.ericsson.ssa.container.sim.SipServletFacade.init
(SipServletFacade.java:75)
at com.ericsson.ssa.container.sim.SipServletWrapper.initialize
(SipServletWrapper.java:379)
at com.ericsson.ssa.container.sim.SipServletWrapper.doLoad
(SipServletWrapper.java:326)
at com.ericsson.ssa.container.sim.SipServletWrapper.allocate
(SipServletWrapper.java:173)
at
com.ericsson.ssa.container.sim.ServletDispatcher.loadServletsMarkedOnStartup
(ServletDispatcher.java:459)
at
com.ericsson.ssa.config.ConvergedContextImpl.loadOnStartupSip
(ConvergedContextImpl.java:261)
at com.ericsson.ssa.config.ConvergedContextImpl.loadOnStartup
(ConvergedContextImpl.java:253)
at org.apache.catalina.core.StandardContext.start
(StandardContext.java:5324)
at com.sun.enterprise.web.WebModule.start(WebModule.java:353)
at com.ericsson.ssa.config.ConvergedContextImpl.start
(ConvergedContextImpl.java:142)
at org.apache.catalina.core.ContainerBase.addChildInternal
(ContainerBase.java:989)
at org.apache.catalina.core.ContainerBase.addChild
(ContainerBase.java:973)
at org.apache.catalina.core.StandardHost.addChild
(StandardHost.java:704)
at com.sun.enterprise.web.WebConta

Amit Bhayani

unread,
Jun 18, 2009, 9:33:03 AM6/18/09
to mobicent...@googlegroups.com
The client (Servlet) will try to bind to port 2727 and server (MMS) binds to 2427. Please see if your 2727 port is free?

Amit Bansal

unread,
Jun 18, 2009, 10:03:10 AM6/18/09
to mobicent...@googlegroups.com
I have checked using the command "netstat -a" but it is not listed in the list means it is free before starting the server.

After starting the server it is in the list.

this is the log when server is started--

Starting SIP Listener:  ip:0.0.0.0 port:5061 transportProtocol:tls
Starting SIP Listener:  ip:0.0.0.0 port:5060 transportProtocol:udp
Starting SIP Listener:  ip:0.0.0.0 port:5060 transportProtocol:tcp
started Application Dispatcher with router com.ericsson.ssa.router.AlphabeticalRouter
Context available with context root/SSMExample
the simple sip servlet has been started
Context available with context root/PlayerServletExample
Driver org.mobicents.Driver_1.0 registered with DriverManager
Jain Mgcp stack bound to IP /127.0.0.1 and UDP port 2727
SMGT0007: Self Management Rules service is enabled
Sip Module started and available.
Application server startup complete.
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
classLoader = WebappClassLoader
  delegate: true
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
EJBClassLoader : 
urlSet = []
doneCalled = false 
 Parent -> java.net.URLClassLoader@15bfdbd
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@14f02fb
ExtensionModulesManager: Unloading of extension module PlayerServletExample successful.
deployed with moduleid = PlayerServletExample
Application /PlayerServletExample configured with SIP persistence type: memory, frequency: null, and scope: null
Context available with context root/PlayerServletExample
Driver org.mobicents.Driver_1.0 registered with DriverManager
Exception Occur:::
java.lang.RuntimeException: Failed to find a local port to bound stack
        at org.mobicents.mgcp.stack.JainMgcpStackImpl.init(JainMgcpStackImpl.java:154)
        at org.mobicents.mgcp.stack.JainMgcpStackImpl.createProvider(JainMgcpStackImpl.java:279)
        at org.mobicents.jsr309.mgcp.MgcpStackFactory.getMgcpStackProvider(MgcpStackFactory.java:81)

Amit Bansal

unread,
Jun 18, 2009, 10:09:03 AM6/18/09
to mobicent...@googlegroups.com
I have have removed the application from the server and then restarted the server then it is in the list of used ports.

It means server is using that port???

Can we change that port to other port??

thanks
-amit

Amit Bansal

unread,
Jun 18, 2009, 10:15:14 AM6/18/09
to mobicent...@googlegroups.com
this is list of ports those are active while server is started.


Proto  Local Address          Foreign Address        State
TCP    dell_08:http           dell_08:0  LISTENING
TCP    dell_08:epmap          dell_08:0  LISTENING
TCP    dell_08:https          dell_08:0  LISTENING
TCP    dell_08:microsoft-ds   dell_08:0  LISTENING
TCP    dell_08:2713           dell_08:0  LISTENING
TCP    dell_08:2718           dell_08:0  LISTENING
TCP    dell_08:8686           dell_08:0  LISTENING
TCP    dell_08:53067          dell_08:0  LISTENING
TCP    dell_08:1119           localhost:18080        ESTABLISHED
TCP    dell_08:1319           localhost:10080        CLOSE_WAIT
TCP    dell_08:1368           localhost:18080        CLOSE_WAIT
TCP    dell_08:1527           dell_08:0  LISTENING
TCP    dell_08:2304           dell_08:0  LISTENING
TCP    dell_08:2605           localhost:18080        ESTABLISHED
TCP    dell_08:2705           dell_08:0  LISTENING
TCP    dell_08:2711           localhost:2712         ESTABLISHED
TCP    dell_08:2712           localhost:2711         ESTABLISHED
TCP    dell_08:2725           localhost:2726         ESTABLISHED
TCP    dell_08:2726           localhost:2725         ESTABLISHED
TCP    dell_08:2727           localhost:2728         ESTABLISHED
TCP    dell_08:2728           localhost:2727         ESTABLISHED
TCP    dell_08:2729           localhost:2730         ESTABLISHED
TCP    dell_08:2730           localhost:2729         ESTABLISHED
TCP    dell_08:2731           localhost:2732         ESTABLISHED
TCP    dell_08:2732           localhost:2731         ESTABLISHED
TCP    dell_08:2733           localhost:2734         ESTABLISHED
TCP    dell_08:2734           localhost:2733         ESTABLISHED
TCP    dell_08:2735           localhost:2736         ESTABLISHED
TCP    dell_08:2736           localhost:2735         ESTABLISHED
TCP    dell_08:2737           localhost:2738         ESTABLISHED
TCP    dell_08:2738           localhost:2737         ESTABLISHED
TCP    dell_08:2739           localhost:2740         ESTABLISHED
TCP    dell_08:2740           localhost:2739         ESTABLISHED
TCP    dell_08:2741           localhost:2742         ESTABLISHED
TCP    dell_08:2742           localhost:2741         ESTABLISHED
TCP    dell_08:2743           localhost:2744         ESTABLISHED
TCP    dell_08:2744           localhost:2743         ESTABLISHED
TCP    dell_08:2745           localhost:2746         ESTABLISHED
TCP    dell_08:2746           localhost:2745         ESTABLISHED
TCP    dell_08:2747           localhost:2748         ESTABLISHED
TCP    dell_08:2748           localhost:2747         ESTABLISHED
TCP    dell_08:2749           localhost:2750         ESTABLISHED
TCP    dell_08:2750           localhost:2749         ESTABLISHED
TCP    dell_08:2751           localhost:2752         ESTABLISHED
TCP    dell_08:2752           localhost:2751         ESTABLISHED
TCP    dell_08:2753           localhost:2754         ESTABLISHED
TCP    dell_08:2754           localhost:2753         ESTABLISHED
TCP    dell_08:2755           localhost:2756         ESTABLISHED
TCP    dell_08:2756           localhost:2755         ESTABLISHED
TCP    dell_08:2757           localhost:2758         ESTABLISHED
TCP    dell_08:2758           localhost:2757         ESTABLISHED
TCP    dell_08:2759           localhost:2760         ESTABLISHED
TCP    dell_08:2760           localhost:2759         ESTABLISHED
TCP    dell_08:2761           localhost:2762         ESTABLISHED
TCP    dell_08:2762           localhost:2761         ESTABLISHED
TCP    dell_08:2763           localhost:2764         ESTABLISHED
TCP    dell_08:2764           localhost:2763         ESTABLISHED
TCP    dell_08:2765           localhost:2766         ESTABLISHED
TCP    dell_08:2766           localhost:2765         ESTABLISHED
TCP    dell_08:2767           localhost:2768         ESTABLISHED
TCP    dell_08:2768           localhost:2767         ESTABLISHED
TCP    dell_08:2769           localhost:2770         ESTABLISHED
TCP    dell_08:2770           localhost:2769         ESTABLISHED
TCP    dell_08:2771           localhost:2773         ESTABLISHED
TCP    dell_08:2772           localhost:2774         ESTABLISHED
TCP    dell_08:2773           localhost:2771         ESTABLISHED
TCP    dell_08:2774           localhost:2772         ESTABLISHED
TCP    dell_08:2775           localhost:2776         ESTABLISHED
TCP    dell_08:2776           localhost:2775         ESTABLISHED
TCP    dell_08:2777           localhost:2778         ESTABLISHED
TCP    dell_08:2778           localhost:2777         ESTABLISHED
TCP    dell_08:2779           localhost:2780         ESTABLISHED
TCP    dell_08:2780           localhost:2779         ESTABLISHED
TCP    dell_08:2781           localhost:2782         ESTABLISHED
TCP    dell_08:2782           localhost:2781         ESTABLISHED
TCP    dell_08:2789           localhost:18080        ESTABLISHED
TCP    dell_08:2790           localhost:18080        ESTABLISHED
TCP    dell_08:10110          localhost:2794         TIME_WAIT
TCP    dell_08:13128          dell_08:0  LISTENING
TCP    dell_08:18080          dell_08:0  LISTENING
TCP    dell_08:18080          localhost:1119         ESTABLISHED
TCP    dell_08:18080          localhost:2605         ESTABLISHED
TCP    dell_08:18080          localhost:2789         ESTABLISHED
TCP    dell_08:18080          localhost:2790         ESTABLISHED
TCP    dell_08:netbios-ssn    dell_08:0  LISTENING
TCP    dell_08:1120           192.168.10.1:8080      ESTABLISHED
TCP    dell_08:1328           122-118-39-145.dynamic.hinet.net:https  ESTABLISHED
TCP    dell_08:2606           192.168.10.1:8080      ESTABLISHED
TCP    dell_08:2713           dell_08:2787  ESTABLISHED
TCP    dell_08:2713           dell_08:2805  ESTABLISHED
TCP    dell_08:2787           dell_08:2713  ESTABLISHED
TCP    dell_08:2791           192.168.10.1:8080      ESTABLISHED
TCP    dell_08:2792           192.168.10.1:8080      ESTABLISHED
TCP    dell_08:2793           dell_08:2713  TIME_WAIT
TCP    dell_08:2795           192.168.10.1:pop3      TIME_WAIT
TCP    dell_08:2801           dell_08:2713  TIME_WAIT
TCP    dell_08:2805           dell_08:2713  ESTABLISHED
TCP    dell_08:2806           192.168.10.1:epmap     ESTABLISHED
TCP    dell_08:2807           192.168.10.1:1025      ESTABLISHED
TCP    dell_08:2809           192.168.10.1:ldap      TIME_WAIT
TCP    dell_08:2810           192.168.10.1:ldap      TIME_WAIT
TCP    dell_08:2811           192.168.10.1:microsoft-ds  ESTABLISHED
UDP    dell_08:https          *:*
UDP    dell_08:microsoft-ds   *:*
UDP    dell_08:isakmp         *:*
UDP    dell_08:1025           *:*
UDP    dell_08:1026           *:*
UDP    dell_08:1088           *:*
UDP    dell_08:1092           *:*
UDP    dell_08:1093           *:*
UDP    dell_08:1094           *:*
UDP    dell_08:1095           *:*
UDP    dell_08:1096           *:*
UDP    dell_08:4500           *:*
UDP    dell_08:5060           *:*
UDP    dell_08:53067          *:*
UDP    dell_08:ntp            *:*
UDP    dell_08:1027           *:*
UDP    dell_08:1041           *:*
UDP    dell_08:1318           *:*
UDP    dell_08:1900           *:*
UDP    dell_08:2427           *:*
UDP    dell_08:ntp            *:*
UDP    dell_08:netbios-ns     *:*
UDP    dell_08:netbios-dgm    *:*
UDP    dell_08:1900           *:*


-- 
Thanks
amit

Amit Bhayani

unread,
Jun 18, 2009, 11:15:21 AM6/18/09
to mobicent...@googlegroups.com
Did you say you start the MMS standalone
And then start the Sip Servlet Server which also has embedded Media Server?

If yes that means both MMS are contending for port 2427 and the one started first will get it

In order to avoid starting the embedded MMS just delete 'mobicents-media-server' from mss-1.0-SNAPSHOT-jboss-5.1.0.GA-0906091045-TECH-PREVIEW/server/default/deploy/

Amit Bansal

unread,
Jun 19, 2009, 1:18:49 AM6/19/09
to mobicent...@googlegroups.com
No, Sip server have not embedded Media server.

I am deploying the SIP servlet in the Sailfin Application server.


Can we change the value of this port.

protected static final int MGW_PORT = 2427;

If yes then I have to mention it some where or just change the value of this variable????

--
Thanks
amit

Amit Bhayani

unread,
Jun 21, 2009, 11:32:10 PM6/21/09
to mobicent...@googlegroups.com
In PlayerServlet.java of media-jsr-309 example the client side MGCP stack binds to property "mgcp.stack.port" and hence change the value of CA_PORT=2727 to may be 2728 or which ever port is free.

Amit Bansal

unread,
Jun 22, 2009, 8:46:10 AM6/22/09
to mobicent...@googlegroups.com
I have changed the value of the CA_PORT to 5555 but it is still starting it on 2727 port??


thanks
-amit

Amit Bhayani

unread,
Jun 24, 2009, 8:58:02 AM6/24/09
to mobicent...@googlegroups.com
Ok realized the problem.

In PlayerServlet I am using property.put(MGCP_STACK_PORT, CA_PORT); where CA_PORT is int and it uses directly the put method of Hashtable instead of setProperty(String key, String value) of java.util.Properties

But while reading the property it uses

portString = properties.getProperty(MGCP_STACK_PORT, "2727");

getProperty checks if value Object is String, if not it returns null and hence in our case will always take default value "2727"

I have fixed this in PlayerServlet. Use it like

        Properties property = new Properties();
        property.setProperty(MGCP_STACK_NAME, "SipServlets");
        property.setProperty(MGCP_PEER_IP, PEER_ADDRESS);
        property.setProperty(MGCP_PEER_PORT, MGW_PORT);

        property.setProperty(MGCP_STACK_IP, LOCAL_ADDRESS);
        property.setProperty(MGCP_STACK_PORT, CA_PORT);

Amit Bansal

unread,
Jun 25, 2009, 3:37:32 AM6/25/09
to mobicent...@googlegroups.com
thanks for the help.....now example is working fine for softphone that is installed on the same machine on which servers are running.

when i have checked the example with softphone that is installed on other system...example is not working means no media is played to the softphone.

--
Thanks
amit

Jean Deruelle

unread,
Jun 25, 2009, 3:52:53 AM6/25/09
to mobicent...@googlegroups.com
make sure you start the server with -b <the binding ip address> like sh run.sh -b 192.168.0.10 by example. and that you sip phone is directed to that address

Amit Bansal

unread,
Jun 25, 2009, 3:57:25 AM6/25/09
to mobicent...@googlegroups.com
I have to start the media server like this ??

"run.bat -b 192.198.10.240"

For application server i am using the Sailfin server.

when i call to the server... call is established but media is not played but for same system softphone example is works fine.

thanks
-amit

Jean Deruelle

unread,
Jun 25, 2009, 4:27:42 AM6/25/09
to mobicent...@googlegroups.com
if you run everything on different machines on a local network yes that's preferrable otherwise it starts on 127.0.0.1 by default

Amit Bansal

unread,
Jun 25, 2009, 4:39:59 AM6/25/09
to mobicent...@googlegroups.com
If i am running the sailfin server and standalone mobicent media server on same machine but softphone is install on other machine then i have to start the media server like this??

"run.bat -b 192.198.10.240"


Jean Deruelle

unread,
Jun 25, 2009, 4:41:36 AM6/25/09
to mobicent...@googlegroups.com
I guess it would be better to do so as well indeed
Reply all
Reply to author
Forward
0 new messages