Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java LDAPException(resultCode=91(连接错误),errorMessage=';尝试连接到服务器时出错_Java_Android_Ldap_Unboundid Ldap Sdk - Fatal编程技术网

Java LDAPException(resultCode=91(连接错误),errorMessage=';尝试连接到服务器时出错

Java LDAPException(resultCode=91(连接错误),errorMessage=';尝试连接到服务器时出错,java,android,ldap,unboundid-ldap-sdk,Java,Android,Ldap,Unboundid Ldap Sdk,我正在尝试使android应用程序连接到LDAP服务器。我正在使用未绑定库,以便我的应用程序能够建立LDAP连接。问题是resultCode 91连接错误,我不知道如何解决。LDAP服务器已启动并正在运行,因为我的桌面应用程序可以建立连接。 我将附上代码: TextView tv = (TextView)findViewById(R.id.textView); try { LDAPConnection c = new LDAPConnection(

我正在尝试使android应用程序连接到LDAP服务器。我正在使用未绑定库,以便我的应用程序能够建立LDAP连接。问题是resultCode 91连接错误,我不知道如何解决。LDAP服务器已启动并正在运行,因为我的桌面应用程序可以建立连接。 我将附上代码:

           TextView tv = (TextView)findViewById(R.id.textView);
     try {
        LDAPConnection c = new LDAPConnection("192.168.106.131",389,"cn=admin,dc=test,dc=com","haha");

        if(c.isConnected())
        {
            tv.setText("good");
        }
        else
        {
            tv.setText("bad");
        }
    } catch (LDAPException e) {
        tv.setText("error");
        e.printStackTrace();
    }
以及来自LogCat的日志:

            05-25 22:56:49.653: E/SELinux(21849): selinux_android_seapp_context_reload:       seapp_contexts file is loaded from /data/security/spota/seapp_contexts
            05-25 22:56:49.663: D/dalvikvm(21849): Late-enabling CheckJNI
            05-25 22:56:50.184: W/dalvikvm(21849): VFY: unable to find class referenced in signature (Ljavax/security/sasl/SaslClient;)
            05-25 22:56:50.184: W/dalvikvm(21849): VFY: unable to find class referenced in signature (Ljavax/security/sasl/SaslClient;)
            05-25 22:56:50.194: I/dalvikvm(21849): Could not find method javax.security.sasl.SaslClient.dispose, referenced from method com.unboundid.ldap.sdk.LDAPConnectionInternals.close
            05-25 22:56:50.194: W/dalvikvm(21849): VFY: unable to resolve interface method 12795: Ljavax/security/sasl/SaslClient;.dispose ()V
            05-25 22:56:50.194: D/dalvikvm(21849): VFY: replacing opcode 0x72 at 0x0040
            05-25 22:56:50.214: I/dalvikvm(21849): Could not find method javax.security.sasl.SaslClient.wrap, referenced from method com.unboundid.ldap.sdk.LDAPConnectionInternals.sendMessage
            05-25 22:56:50.214: W/dalvikvm(21849): VFY: unable to resolve interface method 12801: Ljavax/security/sasl/SaslClient;.wrap ([BII)[B
            05-25 22:56:50.214: D/dalvikvm(21849): VFY: replacing opcode 0x72 at 0x005c
            05-25 22:57:50.448: W/System.err(21849): LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server             192.168.106.131:389:  java.io.IOException: Unable to establish a connection to server 192.168.106.131:389 within the configured timeout of 60000 milliseconds.')
            05-25 22:57:50.448: W/System.err(21849):    at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:755)
            05-25 22:57:50.448: W/System.err(21849):    at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:687)
            05-25 22:57:50.448: W/System.err(21849):    at com.example.aaa.MainActivity.onCreate(MainActivity.java:29)
            05-25 22:57:50.448: W/System.err(21849):    at android.app.Activity.performCreate(Activity.java:5255)
            05-25 22:57:50.448: W/System.err(21849):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
            05-25 22:57:50.448: W/System.err(21849):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2213)
            05-25 22:57:50.448: W/System.err(21849):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
            05-25 22:57:50.448: W/System.err(21849):    at android.app.ActivityThread.access$700(ActivityThread.java:154)
            05-25 22:57:50.448: W/System.err(21849):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)
            05-25 22:57:50.448: W/System.err(21849):    at android.os.Handler.dispatchMessage(Handler.java:99)
            05-25 22:57:50.458: W/System.err(21849):    at android.os.Looper.loop(Looper.java:137)
            05-25 22:57:50.458: W/System.err(21849):    at android.app.ActivityThread.main(ActivityThread.java:5306)
            05-25 22:57:50.458: W/System.err(21849):    at java.lang.reflect.Method.invokeNative(Native Method)
            05-25 22:57:50.458: W/System.err(21849):    at java.lang.reflect.Method.invoke(Method.java:511)
            05-25 22:57:50.458: W/System.err(21849):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
            05-25 22:57:50.458: W/System.err(21849):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
            05-25 22:57:50.458: W/System.err(21849):    at dalvik.system.NativeStart.main(Native Method)
            05-25 22:57:50.458: W/System.err(21849): Caused by: java.io.IOException: Unable to establish a connection to server 192.168.106.131:389 within the configured timeout of 60000 milliseconds.
            05-25 22:57:50.458: W/System.err(21849):    at com.unboundid.ldap.sdk.LDAPConnectionInternals.<init>(LDAPConnectionInternals.java:143)
            05-25 22:57:50.458: W/System.err(21849):    at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:745)
            05-25 22:57:50.458: W/System.err(21849):    ... 16 more
            05-25 22:57:50.468: W/System.err(21849): LDAPException(resultCode=81 (server down), errorMessage='The connection is not established.')
            05-25 22:57:50.468: W/System.err(21849):    at com.unboundid.ldap.sdk.LDAPConnection.registerResponseAcceptor(LDAPConnection.java:4228)
            05-25 22:57:50.468: W/System.err(21849):    at com.unboundid.ldap.sdk.SimpleBindRequest.process(SimpleBindRequest.java:538)
            05-25 22:57:50.468: W/System.err(21849):    at com.unboundid.ldap.sdk.LDAPConnection.bind(LDAPConnection.java:1893)
            05-25 22:57:50.468: W/System.err(21849):    at com.unboundid.ldap.sdk.LDAPConnection.bind(LDAPConnection.java:1855)
            05-25 22:57:50.468: W/System.err(21849):    at com.example.aaa.MainActivity.onCreate(MainActivity.java:46)
            05-25 22:57:50.468: W/System.err(21849):    at android.app.Activity.performCreate(Activity.java:5255)
            05-25 22:57:50.468: W/System.err(21849):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
            05-25 22:57:50.468: W/System.err(21849):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2213)
            05-25 22:57:50.468: W/System.err(21849):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
            05-25 22:57:50.468: W/System.err(21849):    at android.app.ActivityThread.access$700(ActivityThread.java:154)
            05-25 22:57:50.468: W/System.err(21849):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)
            05-25 22:57:50.468: W/System.err(21849):    at android.os.Handler.dispatchMessage(Handler.java:99)
            05-25 22:57:50.478: W/System.err(21849):    at android.os.Looper.loop(Looper.java:137)
            05-25 22:57:50.478: W/System.err(21849):    at android.app.ActivityThread.main(ActivityThread.java:5306)
            05-25 22:57:50.478: W/System.err(21849):    at java.lang.reflect.Method.invokeNative(Native Method)
            05-25 22:57:50.478: W/System.err(21849):    at java.lang.reflect.Method.invoke(Method.java:511)
            05-25 22:57:50.478: W/System.err(21849):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
            05-25 22:57:50.478: W/System.err(21849):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
            05-25 22:57:50.478: W/System.err(21849):    at dalvik.system.NativeStart.main(Native Method)
            05-25 22:57:50.548: D/libEGL(21849): loaded /system/lib/egl/libEGL_adreno200.so
            05-25 22:57:50.548: D/libEGL(21849): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
             05-25 22:57:50.558: D/libEGL(21849): loaded /system/lib/egl/libGLESv2_adreno200.so
            05-25 22:57:50.568: I/Adreno200-EGL(21849): <qeglDrvAPI_eglInitialize:265>: EGL 1.4 QUALCOMM build:   AYELDER_AU_LINUX_ANDROID_JB_2.5.5.04.02.02.092.023+PATCH[ES]_msm8960_JB_2.5.5_CL3556704_rel ease_ENGG (CL3556704)
            05-25 22:57:50.568: I/Adreno200-EGL(21849): Build Date: 05/17/13 Fri
            05-25 22:57:50.568: I/Adreno200-EGL(21849): Local Branch: 
            05-25 22:57:50.568: I/Adreno200-EGL(21849): Remote Branch: quic/jb_2.5.5
            05-25 22:57:50.568: I/Adreno200-EGL(21849): Local Patches: 34c9e193f12610d3e68dabd6198d2c4bfbc66974 RB: Update the master timestamp of the hw_image in rb_texture_update_aliased
             05-25 22:57:50.568: I/Adreno200-EGL(21849): Reconstruct Branch: AU_LINUX_ANDROID_JB_2.5.5.04.02.02.092.023 + 01d3c78 + e6f0547 +  LOCAL_PATCH[ES]
05-25 22:56:49.653:E/SELinux(21849):SELinux_android_seapp_context_重载:seapp_context文件从/data/security/spota/seapp_context加载
05-25 22:56:49.663:D/dalvikvm(21849):延迟启用CheckJNI
05-25 22:56:50.184:W/dalvikvm(21849):VFY:找不到签名中引用的类(Ljavax/security/sasl/SaslClient;)
05-25 22:56:50.184:W/dalvikvm(21849):VFY:找不到签名中引用的类(Ljavax/security/sasl/SaslClient;)
05-25 22:56:50.194:I/dalvikvm(21849):找不到方法javax.security.sasl.SaslClient.dispose,该方法引用自方法com.unbounded.ldap.sdk.LDAPConnectionInternals.close
05-25 22:56:50.194:W/dalvikvm(21849):VFY:无法解析接口方法12795:Ljavax/security/sasl/SaslClient;.dispose()V
05-25 22:56:50.194:D/dalvikvm(21849):VFY:在0x0040处替换操作码0x72
05-25 22:56:50.214:I/dalvikvm(21849):找不到方法javax.security.sasl.SaslClient.wrap,该方法引用自方法com.unbounded.ldap.sdk.LDAPConnectionInternals.sendMessage
05-25 22:56:50.214:W/dalvikvm(21849):VFY:无法解析接口方法12801:Ljavax/security/sasl/SaslClient;.wrap([BII)[B]
05-25 22:56:50.214:D/dalvikvm(21849):VFY:在0x005c处替换操作码0x72
05-25 22:57:50.448:W/System.err(21849):LDAPException(resultCode=91(connect error),errorMessage='尝试连接到服务器192.168.106.131:389:java.io.IOException:无法在配置的60000毫秒超时内建立到服务器192.168.106.131:389的连接。'
05-25 22:57:50.448:W/System.err(21849):位于com.unbounded.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:755)
05-25 22:57:50.448:W/System.err(21849):位于com.unbounded.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:687)
05-25 22:57:50.448:W/System.err(21849):位于com.example.aaa.MainActivity.onCreate(MainActivity.java:29)
05-25 22:57:50.448:W/System.err(21849):位于android.app.Activity.performCreate(Activity.java:5255)
05-25 22:57:50.448:W/System.err(21849):位于android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
05-25 22:57:50.448:W/System.err(21849):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2213)
05-25 22:57:50.448:W/System.err(21849):位于android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
05-25 22:57:50.448:W/System.err(21849):在android.app.ActivityThread.access$700(ActivityThread.java:154)
05-25 22:57:50.448:W/System.err(21849):位于android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)
05-25 22:57:50.448:W/System.err(21849):位于android.os.Handler.dispatchMessage(Handler.java:99)
05-25 22:57:50.458:W/System.err(21849):位于android.os.Looper.loop(Looper.java:137)
05-25 22:57:50.458:W/System.err(21849):位于android.app.ActivityThread.main(ActivityThread.java:5306)
05-25 22:57:50.458:W/System.err(21849):位于java.lang.reflect.Method.invokenactive(本机方法)
05-25 22:57:50.458:W/System.err(21849):位于java.lang.reflect.Method.invoke(Method.java:511)
05-25 22:57:50.458:W/System.err(21849):位于com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
05-25 22:57:50.458:W/System.err(21849):位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
05-25 22:57:50.458:W/System.err(21849):在dalvik.System.NativeStart.main(本机方法)
05-25 22:57:50.458:W/System.err(21849):原因:java.io.IOException:无法在配置的60000毫秒超时内建立到服务器192.168.106.131:389的连接。
05-25 22:57:50.458:W/System.err(21849):位于com.unbounded.ldap.sdk.LDAPConnectionInternals。(LDAPConnectionInternals.java:143)
05-25 22:57:50.458:W/System.err(21849):位于com.unbounded.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:745)
05-25 22:57:50.458:W/系统错误(21849):…还有16个
05-25 22:57:50.468:W/System.err(21849):LDAPException(resultCode=81(服务器关闭),errorMessage='未建立连接!')
05-25 22:57:50.468:W/System.err(21849):位于com.unbounded.ldap.sdk.LDAPConnection.RegisterResponseAceptor(LDAPConnection.java:4228)
05-25 22:57:50.468:W/System.err(21849):位于com.unbounded.ldap.sdk.SimpleBindRequest.process(SimpleBindRequest.java:538)
05-25 22:57:50.468:W/System.err(21849):位于com.unbounded.ldap.sdk.LDAPConnection.bind(LDAPConnection.java:1893)
05-25 22:57:50.468:W/System.err(21849):位于com.unbounded.ldap.sdk.LDAPConnection.bind(LDAPConnection.java:1855)
05-25 22:57:50.468:W/System.err(21849):位于com.example.aaa.MainActivity.onCreate(MainActivity.java:46)
05-25 22:57:50.468:W/System.err(21849):位于android.app.Activity.performCreate(Activity.java:5255)
05-25 22:57:50.468:W/System.err(21849):位于android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
05-25 22:57:50.468:W/System.err(21849):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2213)