我是一个新的 android 开发人员,目前我正在尝试在 andorid 中实现 JSIP。当我在andorid中添加jsip api时,一个错误告诉我jsip的javax包与java的默认javax包冲突。
所以我把所有的javax包都改成了com.g5.javax.*这种格式。然后错误消失。但现在又出现了另一个错误,我附上了这条消息。它向我抛出 java.lang.reflect.InvocationTargetException 和 javax.sip.PeerUnavailableException: stack name is missing 错误。我检查并仔细检查了 jain sip 源,发现属性键“com.g5.javax.sip.STACK_NAME”(通过使用 eclipse 重构更改)具有我给出的值。但每次都出现错误。另一个有趣的信息是我创建的同一个 jar 包在桌面应用程序中完美运行。我已经坚持这个错误2天了。
09-27 04:58:13.819: I/System.out(564): class java.util.Properties
09-27 04:58:13.839: I/System.out(564): {com.g5.javax.sip.STACK_NAME=123}
09-27 04:58:13.869: E/com.g5(564): cannot instantiate
09-27 04:58:13.869: E/com.g5(564): com.g5.javax.sip.PeerUnavailableException: The Peer SIP Stack: gov.nist.javax.sip.SipStackImpl could not be instantiated. Ensure the Path Name has been set.
09-27 04:58:13.869: E/com.g5(564): at com.g5.javax.sip.SipFactory.createStack(SipFactory.java:332)
09-27 04:58:13.869: E/com.g5(564): at com.g5.javax.sip.SipFactory.createSipStack(SipFactory.java:154)
09-27 04:58:13.869: E/com.g5(564): at com.shootme.Shootme.init(Shootme.java:104)
09-27 04:58:13.869: E/com.g5(564): at com.shootme.Shootme.onCreate(Shootme.java:87)
09-27 04:58:13.869: E/com.g5(564): at android.app.Activity.performCreate(Activity.java:4465)
09-27 04:58:13.869: E/com.g5(564): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
09-27 04:58:13.869: E/com.g5(564): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
09-27 04:58:13.869: E/com.g5(564): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
09-27 04:58:13.869: E/com.g5(564): at android.app.ActivityThread.access$600(ActivityThread.java:123)
09-27 04:58:13.869: E/com.g5(564): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
09-27 04:58:13.869: E/com.g5(564): at android.os.Handler.dispatchMessage(Handler.java:99)
09-27 04:58:13.869: E/com.g5(564): at android.os.Looper.loop(Looper.java:137)
09-27 04:58:13.869: E/com.g5(564): at android.app.ActivityThread.main(ActivityThread.java:4424)
09-27 04:58:13.869: E/com.g5(564): at java.lang.reflect.Method.invokeNative(Native Method)
09-27 04:58:13.869: E/com.g5(564): at java.lang.reflect.Method.invoke(Method.java:511)
09-27 04:58:13.869: E/com.g5(564): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
09-27 04:58:13.869: E/com.g5(564): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
09-27 04:58:13.869: E/com.g5(564): at dalvik.system.NativeStart.main(Native Method)
09-27 04:58:13.869: E/com.g5(564): Caused by: java.lang.reflect.InvocationTargetException
09-27 04:58:13.869: E/com.g5(564): at java.lang.reflect.Constructor.constructNative(Native Method)
09-27 04:58:13.869: E/com.g5(564): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
09-27 04:58:13.869: E/com.g5(564): at com.g5.javax.sip.SipFactory.createStack(SipFactory.java:322)
09-27 04:58:13.869: E/com.g5(564): ... 17 more
09-27 04:58:13.869: E/com.g5(564): Caused by: javax.sip.PeerUnavailableException: stack name is missing
09-27 04:58:13.869: E/com.g5(564): at gov.nist.javax.sip.SipStackImpl.<init>(SipStackImpl.java:554)