小编jus*_*m30的帖子

Spring Boot Actuator - LDAP健康端点投掷NPE

在我们的Spring Boot应用程序中,我们spring-security-ldap用于验证可以访问我们应用程序的用户.我们在功能上看不到任何与身份验证有关的问题,但是当我们点击/authenticator/healthURL时,我们会获得ldap的以下状态:

"ldap": {
    "status": "DOWN",
    "error": "java.lang.NullPointerException: null"
}
Run Code Online (Sandbox Code Playgroud)

跟踪此空指针异常,我们在尝试访问时获取此跟踪env.put(Context.SECURITY_PRINCIPAL, userDn);:

java.lang.NullPointerException: null
    at java.util.Hashtable.put(Unknown Source) ~[na:1.8.0_111]
    at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42) ~[spring-ldap-core-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.ldap.core.support.AbstractContextSource.setupAuthenticatedEnvironment(AbstractContextSource.java:194) ~[spring-ldap-core-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.ldap.core.support.AbstractContextSource.getAuthenticatedEnv(AbstractContextSource.java:582) ~[spring-ldap-core-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:134) ~[spring-ldap-core-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.ldap.core.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:158) ~[spring-ldap-core-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.ldap.core.LdapTemplate.executeReadOnly(LdapTemplate.java:802) ~[spring-ldap-core-2.3.1.RELEASE.jar:2.3.1.RELEASE]
    at org.springframework.boot.actuate.health.LdapHealthIndicator.doHealthCheck(LdapHealthIndicator.java:46) ~[spring-boot-actuator-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:43) ~[spring-boot-actuator-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:68) [spring-boot-actuator-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.actuate.endpoint.HealthEndpoint.invoke(HealthEndpoint.java:81) [spring-boot-actuator-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.getHealth(HealthMvcEndpoint.java:171) [spring-boot-actuator-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(HealthMvcEndpoint.java:145) [spring-boot-actuator-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_111]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_111]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_111]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]
    at …
Run Code Online (Sandbox Code Playgroud)

spring spring-ldap spring-boot spring-boot-actuator

13
推荐指数
2
解决办法
5628
查看次数

UITableViewCell annexView删除右边距

在上添加创建自定义accessoryView设置后UITableViewCell,iOS 似乎在iPhone上默认默认边距为15px,在iPad上默认为20px。我们正在尝试UIButton在附件视图中放置a ,因此不需要此边距。这是一个非常简单的示例,其中橙色正方形是带有不必要的右边距的辅助视图:

屏幕截图

我真的希望不要覆盖layoutSubviews并移动accessoryView框架。还有其他方法可以删除此默认边距吗?谢谢!

uitableview accessoryview ios

5
推荐指数
0
解决办法
1556
查看次数

Android和WiFi Direct - 连接问题

所以我在很长一段时间内一直在使用WiFi Direct,而且整个过程中我一直困扰着连接问题.由于更新到4.1,不再有硬按钮打开和关闭WiFi Direct,我似乎总是与连接不一致.对于我的用途,我不需要找到对等体,只需从早期交互中的存储设备地址连接到对等体.有时设备会立即连接,有时第二个设备将不会收到邀请,有时第一个设备会被卡住,试图无限期地发送邀请.下面是我的连接代码,它非常裸露,所以我不确定是什么问题.任何帮助,将不胜感激!非常感谢你.

WifiP2pConfig config = new WifiP2pConfig();
SlideMenuItem item = sideMenu.getItem(itemId);
config.deviceAddress = item.label;
config.wps.setup = WpsInfo.PBC;

if (progressDialog != null && progressDialog.isShowing()) {
     progressDialog.dismiss();
 }
progressDialog = ProgressDialog.show(mContext, "Press back to cancel",
                "Connecting to :" + item.label, true, true);
manager.connect(channel, config, new ActionListener() {

            @Override
            public void onSuccess() {
                // WiFiDirectBroadcastReceiver will notify us. Ignore for now.
            }

            @Override
            public void onFailure(int reason) {
                Toast.makeText(mContext, "Connect failed. Retry.", Toast.LENGTH_SHORT).show();
            }
        });

@Override
public void onConnectionInfoAvailable(WifiP2pInfo arg0) {
    // …
Run Code Online (Sandbox Code Playgroud)

android wifi wifi-direct

4
推荐指数
1
解决办法
1万
查看次数

Android上的OpenCV - 标题; 没有这样的文件/目录

所以我不熟悉使用JNI for Android,如果这是愚蠢的话,请提前对不起.我已经安装了SDK,并且在Eclipse中已将其添加为项目库.在完成所有操作后,我尝试运行ndk-build函数但得到此错误:

Compile++ thumb  : face_detect_rec <= jni_part.cpp
In file included from jni/face_detect_rec.h:11:0,
                 from jni/jni_part.cpp:3:
/Users/Justin/Documents/Android/opencv-2.4.3.2-android-sdk/sdk/native/jni/include/opencv2/core/core.hpp:56:21: fatal error: algorithm: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/face_detect_rec/jni_part.o] Error 1
Run Code Online (Sandbox Code Playgroud)

该文件位置是core.hpp的位置,所以我不确定为什么这是一个问题.我将在下面发布我的代码供参考,谢谢大家!

jni_part.cpp:

#include <jni.h>
#include "face_detect_rec.h"

using namespace std;
using namespace cv;

extern "C" {


JNIEXPORT void JNICALL Java_com_example_opencvandroidtest_MainActivity_detectFaces(
        JNIEnv* env, jclass mClass, jstring filePath)
{
    detectFaces(filePath);
}
}
Run Code Online (Sandbox Code Playgroud)

face_detect_rec.h

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <time.h>
#include <ctype.h> …
Run Code Online (Sandbox Code Playgroud)

java-native-interface android opencv

3
推荐指数
1
解决办法
6318
查看次数