gpt4 book ai didi

android - 带有 java.lang.reflect.InvocationTargetException 的 android 上的 JAIN SIP

转载 作者:行者123 更新时间:2023-11-30 04:00:15 25 4
gpt4 key购买 nike

我是一名新的 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)

最佳答案

我也遇到了同样的问题,所以我尝试更深入地挖掘,因为没有报告堆栈实现的错误。从这里我得到了这个错误:

11-11 18:51:01.025: W/System.err(17454): javax.sip.PeerUnavailableException: stack name is missing
11-11 18:51:01.025: W/System.err(17454): at gov.nist.javax.sip.SipStackImpl.<init>(SipStackImpl.java:554)
11-11 18:51:01.025: W/System.err(17454): at not.javax.sip.SipFactory.createStack(SipFactory.java:322)
11-11 18:51:01.025: W/System.err(17454): at not.javax.sip.SipFactory.createSipStack(SipFactory.java:171)
11-11 18:51:01.025: W/System.err(17454): at org.jaintest.MainActivity.init(MainActivity.java:110)
11-11 18:51:01.025: W/System.err(17454): at org.jaintest.MainActivity.onCreate(MainActivity.java:68)
11-11 18:51:01.025: W/System.err(17454): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-11 18:51:01.025: W/System.err(17454): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
11-11 18:51:01.025: W/System.err(17454): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
11-11 18:51:01.025: W/System.err(17454): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-11 18:51:01.025: W/System.err(17454): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
11-11 18:51:01.025: W/System.err(17454): at android.os.Handler.dispatchMessage(Handler.java:99)
11-11 18:51:01.025: W/System.err(17454): at android.os.Looper.loop(Looper.java:123)
11-11 18:51:01.025: W/System.err(17454): at android.app.ActivityThread.main(ActivityThread.java:3691)
11-11 18:51:01.025: W/System.err(17454): at java.lang.reflect.Method.invokeNative(Native Method)
11-11 18:51:01.025: W/System.err(17454): at java.lang.reflect.Method.invoke(Method.java:507)
11-11 18:51:01.025: W/System.err(17454): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
11-11 18:51:01.025: W/System.err(17454): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
11-11 18:51:01.025: W/System.err(17454): at dalvik.system.NativeStart.main(Native Method)

现在问题来了。我查看了 SipStackImpl 类的代码并找到了这些行:

String name = configurationProperties
.getProperty("com.tlccom.javax.sip.STACK_NAME");
if (name == null)
throw new PeerUnavailableException("stack name is missing");

所以这意味着该名称未被提取。所以我给了这个名字一个字符串值,但仍然有错误,这让我相信 SipStackImpl 是从其他地方获取的。问题是我不知道在哪里,我已经在整个项目中搜索了那个错误,那是它唯一存在的地方,所以它一定来自某个地方(即使注释掉错误检测仍然会留下错误)。这就是我现在卡住的地方,希望这对您有所帮助,如果您发现任何额外的信息,请告诉我

关于android - 带有 java.lang.reflect.InvocationTargetException 的 android 上的 JAIN SIP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12614527/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com