cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
722
Views
1
Helpful
4
Replies

Program won't exit (CUCM 10.5)

Greenberet
Level 1
Level 1

Hello,

when I create an application with jtapi, then it will never exit.

I've even created a simple program which just uses the provider, but the program won't exit.

import javax.telephony.*;

public class Startup {

    /**

     * @param args

     */

    public static void main(String[] args) {

        // TODO Auto-generated method stub

        try

        {

            JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);

            String providerString = "<server>;login=<user>;passwd=<password>;appinfo=BusyLamp";

            Provider provider = peer.getProvider(providerString);

           

            System.out.format("Started Provider");

            provider.shutdown();

            System.out.format("Provider Shutdown");

           

        }catch( Exception e)

        {

       

        }

    }

}

The main function will return, but the program will never exit.

Am I missing something here or is this a bug?

1 Accepted Solution

Accepted Solutions

Hello,

you gave me the right hint.

I've just disabled logging via

                var properties = peer.getJtapiProperties();
                properties.setUseFileTrace(false);
                properties.setUseJavaConsoleTrace(false);

and now it is working as expected =)

View solution in original post

4 Replies 4

mpotluri
Level 5
Level 5

You may want to try 'System.exit(0);' at the end.

If you have JDK installed, you can run jconsole to check if there are any threads running.

Hello,

sorry for the late delay, but I was on holiday.

This didn't really work well =(.

I've also tried this with OpenJDK & ikvm (.NET Wrapper)

This is the Callstack with .NET

  • mscorlib.dll!System.Threading.Monitor.Wait(object obj, int millisecondsTimeout, bool exitContext) + 0x16 bytes
  • mscorlib.dll!System.Threading.Monitor.Wait(object obj) + 0xa bytes
  • IKVM.OpenJDK.Core.dll!java.lang.Thread.objectWait() + 0x116 bytes
  • IKVM.OpenJDK.Core.dll!java.lang.Object.instancehelper_wait(object this = {java.lang.Object}) + 0x28 bytes
  • jtapi.dll!com.cisco.cti.util.BlockingQueue.take() + 0x4c2 bytes
  • jtapi.dll!com.cisco.cti.util.MessageThread.run() + 0x31d bytes
  • IKVM.OpenJDK.Core.dll!java.lang.Thread.threadProc2() + 0x47 bytes
  • IKVM.OpenJDK.Core.dll!java.lang.Thread.threadProc() + 0x47 bytes
  • IKVM.OpenJDK.Core.dll!java.lang.Thread$1.Invoke() + 0x23 bytes
  • mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x6f bytes
  • mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0xa7 bytes
  • mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x16 bytes
  • mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x41 bytes
  • mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes

krzys1988
Level 1
Level 1

Hi.

I had the same issue. My solution was to disable logger thread.

Try adding jtapi.ini file with following configuration:

UseLogFileTraceWriteThread=0

Hope it helps

Hello,

you gave me the right hint.

I've just disabled logging via

                var properties = peer.getJtapiProperties();
                properties.setUseFileTrace(false);
                properties.setUseJavaConsoleTrace(false);

and now it is working as expected =)