Sip-Servlets:custom network layer implementation for SipStackImpl

156 views
Skip to first unread message

Олег Мигрин

unread,
Jan 17, 2011, 11:18:08 AM1/17/11
to mobicents-public
Hello All,
I work with Mobicents SIP-Servlets-Tomcat-1.6-SNAPSHOT, and
trying to implement NETWORK_LAYER configuration property of a
SipStackImpl .

I made following steps:

- Created own implementation of a TLSNetworkLayer ()
- Added to props:
gov.nist.javax.sip.NETWORK_LAYER=path.to.class.TLSNetworkLayer

But I met the problem:
....
LifecycleException: A problem occured while initializing the SIP
Stack: javax.sip.PeerUnavailableException: The Peer SIP Stack:
gov.nist.javax.sip.SipStackImpl could not be instantiated. Ensure the
Path Name has been set
...

MY ATTEMPTS:

- Put compiled file to /WEB-INF/classes/path/to/class/;
- Recompile TLSNetworkLayer to "gov.nist.javax.sip." package name,
specify compiled class to /WEB-INF/classes/gov/nist/javax/sip/;
- Put compiled class int jain-sip-ri.jar;

Everytime I got PeerUnavailableException;

Another question, where I can find the right sources for SipStackImpl
and others (jain-sip-ri)
looks like ../svn/tags/jain-sip/1.2-build161 and jain-sip.dev.java.net
is not appropriate..

Thanks for reply!




Jean Deruelle

unread,
Jan 19, 2011, 5:14:43 AM1/19/11
to mobicent...@googlegroups.com
You need to put the jar into 
$TOMCAT_HOME/lib

And provide the server.log if that fails to see what the exception is.

Jean

Олег Мигрин

unread,
Jan 19, 2011, 9:03:32 AM1/19/11
to mobicents-public
I followed you tip:
1) made jar file tls-network-layer.jar file and put in TOMCAT_HOME/lib
2) Added to catalina.bat this line: ;%CATALINA_HOME%\lib\tls-network-
layer.jar (into line set "CLASSPATH=...")
3) Alot other similar experiments;

In all cases I got the trace:
--------------------------------------------------------------------------------------------------------------
Jan 19 15:58:43,434 [main]
org.mobicents.servlet.sip.startup.SipStandardService INFO: Pretty
encoding of headers enabled ? true
Jan 19 15:58:43,437 [main]
org.mobicents.servlet.sip.startup.SipStandardService INFO: Sip Stack
path name : gov.nist
Jan 19 15:58:43,829 [main]
org.mobicents.servlet.sip.startup.SipStandardService DEBUG:
Initializing SIP stack
Jan 19 15:58:43,830 [main]
org.mobicents.servlet.sip.startup.SipStandardService DEBUG: Loading
SIP stack properties from following file :
file:///D:/Dev/trunk/build/Debug/callcontrol/runtime/tomcat/../../conf/mss-sip-stack.properties
Jan 19 15:58:43,831 [main]
org.mobicents.servlet.sip.startup.SipStandardService INFO: Mobicents
Sip Servlets sip stack properties :
{gov.nist.javax.sip.PASS_INVITE_NON_2XX_ACK_TO_LISTENER=true,
gov.nist.javax.sip.LOG4J_LOGGER_NAME=gov.nist,
javax.sip.AUTOMATIC_DIALOG_SUPPORT=off,
gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS=TLSv1,
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=256000,
javax.sip.STACK_NAME=Mobicents-SIP-Servlets,
gov.nist.javax.sip.NETWORK_LAYER=com.avistar.callcontrol.security.TLSNetworkLayer,
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=false,
gov.nist.javax.sip.TRACE_LEVEL=LOG4J,
gov.nist.javax.sip.MAX_MESSAGE_SIZE=8192,
gov.nist.javax.sip.AUTOMATIC_DIALOG_ERROR_HANDLING=false,
gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE=Want,
gov.nist.javax.sip.SEND_UDP_BUFFER_SIZE=256000,
gov.nist.javax.sip.LOG_MESSAGE_CONTENT=false,
gov.nist.javax.sip.THREAD_POOL_SIZE=64,
gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY=true}
Jan 19 15:58:43,888 [main] gov.nist.javax.sip.SipStackImpl WARN: using
default tls security policy
Jan 19 15:58:43,937 [main] gov.nist.javax.sip.SipStackImpl INFO: using
Want tls auth policy
Jan 19 15:58:43,954 [main] org.apache.catalina.startup.Catalina ERROR:
Catalina.start
LifecycleException: A problem occured while initializing the SIP
Stack: javax.sip.PeerUnavailableException: The Peer SIP Stack:
gov.nist.javax.sip.SipStackImpl could not be instantiated. Ensure the
Path Name has been set.
at
org.mobicents.servlet.sip.startup.SipStandardService.initSipStack(SipStandardService.java:
521)
at
org.mobicents.servlet.sip.startup.SipStandardService.initialize(SipStandardService.java:
242)
at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:
795)
at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
at org.apache.catalina.startup.Catalina.load(Catalina.java:548)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Jan 19 15:58:44,621 [main]
org.mobicents.servlet.sip.startup.SipHostConfig DEBUG: WEB-INF/sip.xml
found in D:\Dev\trunk\build\Debug\callcontrol\webapps\ROOT. Enabling
sip servlet archive deployment
Jan 19 15:58:44,640 [main]
org.mobicents.servlet.sip.startup.SipStandardContext INFO: Starting
the sip context
Jan 19 15:58:44,640 [main]
org.mobicents.servlet.sip.startup.SipStandardContext DEBUG:
Configuring default Resources
Jan 19 15:58:44,658 [main]
org.mobicents.servlet.sip.startup.SipStandardContext INFO:
Initializing the sip context
Jan 19 15:58:44,682 [main]
org.mobicents.servlet.sip.startup.SipStandardContext INFO: sip context
Initialized
Jan 19 15:58:44,717 [main]
org.mobicents.servlet.sip.startup.SipContextConfig DEBUG: starting
sipContextConfig

-------------------------------------------------------------------------------------------------------------
Which way I can upload my jar file and full logs...?

Thanks for reply!



On Jan 19, 12:14 pm, Jean Deruelle <jean.derue...@gmail.com> wrote:
> You need to put the jar into
> $TOMCAT_HOME/lib
>
> And provide the server.log if that fails to see what the exception is.
>
> Jean
>

Олег Мигрин

unread,
Jan 19, 2011, 9:06:12 AM1/19/11
to mobicents-public
And this is the part of starting output:
-------------------------------------------------------------------------------------------------------------
cmd /c D:\Dev\trunk\build\Debug\callcontrol\runtime\tomcat\bin
\catalina.bat run
Using CATALINA_BASE: "D:\Dev\trunk\build\Debug\callcontrol"
Using CATALINA_HOME: "D:\Dev\trunk\build\Debug\callcontrol\runtime
\tomcat"
Using CATALINA_TMPDIR: "D:\Dev\trunk\build\Debug\callcontrol\temp"
Using JRE_HOME: "D:\Dev\BuildTools\jdk1.6.0_12\jre"
Using CLASSPATH: "D:\Dev\trunk\build\Debug\callcontrol\runtime
\tomcat\bin\bootstrap.jar;D:\Dev\trunk\build\Debug\callcontrol\runtime
\tomcat\lib\slf4j-api-1.5.11.jar;D:\Dev\trunk\build\Debug\callcontrol
\runtime\tomcat\lib\jul-to-slf4j-1.5.11.jar;D:\Dev\trunk\build\Debug
\callcontrol\runtime\tomcat\lib\slf4j-log4j12-1.5.11.jar;D:\Dev\trunk
\build\Debug\callcontrol\runtime\tomcat\lib\log4j-1.2.14.jar;D:\Dev
\trunk\build\Debug\callcontrol\runtime\tomcat\lib\tls-network-
layer.jar"
Connected to the target VM, address: '127.0.0.1:55431', transport:
'socket'
-------------------------------------------------------------------------------------------------------------

Jean Deruelle

unread,
Jan 19, 2011, 9:11:06 AM1/19/11
to mobicent...@googlegroups.com
just mail mobicent...@googlegroups.com and attach your files as you do in a regular email

Олег Мигрин

unread,
Jan 19, 2011, 9:24:36 AM1/19/11
to mobicents-public
Ok. I sent files

On Jan 19, 4:11 pm, Jean Deruelle <jean.derue...@gmail.com> wrote:
> just mail mobicent...@googlegroups.com and attach your files as you do
> in a regular email
>

Jean Deruelle

unread,
Jan 19, 2011, 10:34:46 AM1/19/11
to mobicent...@googlegroups.com
Your class misses a public default (no args) Constructor. That is the reason, I'll make a fix to improve the error logging of jain sip in that case.

Jean

Олег Мигрин

unread,
Jan 19, 2011, 10:45:29 AM1/19/11
to mobicents-public

Unfortunate mistake.., thanks for your help!

On Jan 19, 5:34 pm, Jean Deruelle <jean.derue...@gmail.com> wrote:
> Your class misses a public default (no args) Constructor. That is the
> reason, I'll make a fix to improve the error logging of jain sip in that
> case.
>
> Jean
>

Олег Мигрин

unread,
Jan 19, 2011, 12:50:16 PM1/19/11
to mobicents-public
Jean,
and when can I expect improved logging for jain-sip-ri ?
Still no progress after your advise - I added default constructor and
stilll see the same exception,
I made several different attempts to get it to work.

Jean Deruelle

unread,
Jan 19, 2011, 12:57:11 PM1/19/11
to mobicent...@googlegroups.com
with tomorrow's build. Can you provide the source code, also make all classes which you class depends on are present in the lib folder

Олег Мигрин

unread,
Jan 21, 2011, 5:12:29 AM1/21/11
to mobicents-public
OK.
I attached lib files from Tomcat/lib and source code for
TLSNetworkLayer
(actually the code is almost the same like as SslNetworkLayer
implementation).
I'm using JRE_HOME=.....\jdk1.6.0_12\jre

On Jan 19, 7:57 pm, Jean Deruelle <jean.derue...@gmail.com> wrote:
> with tomorrow's build. Can you provide the source code, also make all
> classes which you class depends on are present in the lib folder
>
Message has been deleted

Олег Мигрин

unread,
Jan 21, 2011, 5:18:19 AM1/21/11
to mobicents-public
Mail with libs is backed as 'too large'.... I'll resend it by parts.

Jean Deruelle

unread,
Jan 21, 2011, 5:20:37 AM1/21/11
to mobicent...@googlegroups.com
don't attach libs from Tomcat/lib I meant that you put all the libs that your class depend on into Tomcat/lib in case when loading the class it cannot resolve some class at runtime.

Like if you depend on a mypackage.MyClass located in another jar make sure this jar is present as well in tomcat/lib

Олег Мигрин

unread,
Jan 21, 2011, 5:23:27 AM1/21/11
to mobicents-public
Ok, just a minute

On Jan 21, 12:20 pm, Jean Deruelle <jean.derue...@gmail.com> wrote:
> don't attach libs from Tomcat/lib I meant that you put all the libs that
> your class depend on into Tomcat/lib in case when loading the class it
> cannot resolve some class at runtime.
>
> Like if you depend on a mypackage.MyClass located in another jar make sure
> this jar is present as well in tomcat/lib
>
> ...
>
> read more »

Олег Мигрин

unread,
Jan 21, 2011, 5:39:44 AM1/21/11
to mobicents-public
Actually my last attempts is based on the same source as
SslNetworkLayer (that implemented in jain-sip-ri),
so I think there's no specific jar debendencies - only standard JDK
libs. Anyway I have one more idea about the problem,
looks like my compiling jdk and jre for running tomcat have different
versions.
Maybe the problem in this..
> ...
>
> read more »

Jean Deruelle

unread,
Jan 21, 2011, 5:42:21 AM1/21/11
to mobicent...@googlegroups.com
SslNetworkLayer is not loaded up the same way by the stack, use DefaultNetworkLayer source code instead

Олег Мигрин

unread,
Jan 21, 2011, 5:45:38 AM1/21/11
to mobicents-public
Thanks! I'll try it

On Jan 21, 12:42 pm, Jean Deruelle <jean.derue...@gmail.com> wrote:
> SslNetworkLayer is not loaded up the same way by the stack,
> use DefaultNetworkLayer source code instead
>
> ...
>
> read more »

Олег Мигрин

unread,
Jan 21, 2011, 6:26:27 AM1/21/11
to mobicents-public
And now it works!
Thanks for your advise, Jean

On Jan 21, 12:42 pm, Jean Deruelle <jean.derue...@gmail.com> wrote:
> SslNetworkLayer is not loaded up the same way by the stack,
> use DefaultNetworkLayer source code instead
>
> ...
>
> read more »

Jean Deruelle

unread,
Jan 21, 2011, 7:12:07 AM1/21/11
to mobicent...@googlegroups.com
My pleasure :-)
Reply all
Reply to author
Forward
0 new messages