About Sample Code

Discuss any topic about <A href="http://www.brekeke.com/telephony/">Brekeke JTAPI SDK</A>.

Moderator: Brekeke Support Team

Locked
JSTsai
Posts: 3
Joined: Tue Jul 24, 2007 2:05 am

About Sample Code

Post by JSTsai »

1. Brekeke Product Name and version:
Brekeke JTAPI

2. Java version:
JDK1.5.0_12

3. OS type and the version:
Windows 2000 SP4

4. UA (phone), gateway or other hardware/software involved:
Brekeke OnDo Server 1.5.20

5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/ ... terns.html :
Pattern 8

6. Your problem:

I had modified the 'Sample 1' on your JTAPI page to test. The only modification is as followed:
static private String DialNo = "4803";

'4803' is my SIP Account on our SIP Server.
I had follow the instructions of our FAE to set my provider.properties file.

When compiled the code I modified, there is always some warning as followed:
C:\JTAPI1.0\work\jar\jtapibase>javac -Xlint CalloutPlay.java
CalloutPlay.java:240: warning: [deprecation] triggerRTC(javax.telephony.media.Symbol) in javax.telephony.media.MediaService has been deprecated
static class CallPlayer extends BasicMediaService implements Runnable {
^
CalloutPlay.java:240: warning: [deprecation] async_triggerRTC(javax.telephony.media.Symbol) in javax.telephony.media.async.Async.MediaService has been deprecated
static class CallPlayer extends BasicMediaService implements Runnable {
^
CalloutPlay.java:240: warning: [deprecation] triggerRTC(javax.telephony.media.Symbol) in javax.telephony.media.MediaService has been deprecated
static class CallPlayer extends BasicMediaService implements Runnable {
^
CalloutPlay.java:240: warning: [deprecation] async_triggerRTC(javax.telephony.media.Symbol) in javax.telephony.media.async.Async.MediaService has been deprecated
static class CallPlayer extends BasicMediaService implements Runnable {
^
4 warnings

I know that this is because I overload these class.

When run the code I modified, there is always some Exception as followed:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Category
at com.brekeke.util.Dump.<clinit>(Dump.java:23)
at com.brekeke.jtapi.BrPeer.getProvider(BrPeer.java:71)
at CalloutPlay.main(CalloutPlay.java:32)

Would you tell me how to make this sample code work?
Andrea
Posts: 36
Joined: Wed Apr 04, 2007 11:41 am

Post by Andrea »

You need to include all jar files that Brekeke provided in classpath.

Cheers,
Andrea
JSTsai
Posts: 3
Joined: Tue Jul 24, 2007 2:05 am

Post by JSTsai »

Thanks for Andrea's help.

I've got another problem now.

There is the jdb Message as followed.

> run
run CalloutPlay
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
>
VM Started:
Exception occurred: java.lang.ClassNotFoundException (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=200 bci=72

main[1] cont
>
Exception occurred: java.lang.ClassNotFoundException (uncaught)"thread=main", java.net.URLClassLoader.findClass(), line=205 bci=28

main[1] cont
java.lang.NoClassDefFoundError: CalloutPlay
> Exception in thread "main"
The application exited

Am I do something wrong?

Thanks,again.

JSTsai
Andrea
Posts: 36
Joined: Wed Apr 04, 2007 11:41 am

Post by Andrea »

Hi,

"java.lang.NoClassDefFoundError"
It's still classpath problem.

Run with the following command:
java -classpath <specify jar path>;<jar path>;<jar path> CalloutPlay


Andrea
JSTsai
Posts: 3
Joined: Tue Jul 24, 2007 2:05 am

Post by JSTsai »

Thanks for Andrea's help. But the same situation happens again.

The JAVA debug Messages are as fallowed.

C:\JTAPI1.0\work\jar\jtapibase>jdb -classpath C:\JTAPI1.0\work\jar\jtapi-spec.jar;C:\JTAPI1.0\work\jar\jtapibase.jar;C:\JTAPI1.0\work\jar\log4j-core.jar;C:\JTAP
I1.0\work\jar\log4j.jar CalloutPlay
Initializing jdb ...
> run
run CalloutPlay
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
>
VM Started:
Exception occurred: java.lang.ClassNotFoundException (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=200 bci=72

main[1] cont
>
Exception occurred: java.lang.ClassNotFoundException (uncaught)"thread=main", java.net.URLClassLoader.findClass(), line=205 bci=28

main[1] cont
java.lang.NoClassDefFoundError: CalloutPlay
> Exception in thread "main"
The application exited

Thanks,again.

JSTsai
Andrea
Posts: 36
Joined: Wed Apr 04, 2007 11:41 am

Post by Andrea »

JSTsai,

Try adding current directory "." in your class path.

Andrea
Locked