Java 配置Activemq web控制台以使用LDAP进行授权和身份验证

Java 配置Activemq web控制台以使用LDAP进行授权和身份验证,java,authentication,ldap,jetty,activemq,Java,Authentication,Ldap,Jetty,Activemq,配置activemq web控制台以使用ldap进行身份验证和授权时,我遇到以下错误。我正在为此使用免费的在线测试ldap,并出现以下错误: java.lang.AbstractMethodError: org.eclipse.jetty.jaas.JAASLoginService.login(Ljava/lang/String;Ljava/lang/Object;)Lorg/eclipse/jetty/server/UserIdentity; at org.eclipse.j

配置activemq web控制台以使用ldap进行身份验证和授权时,我遇到以下错误。我正在为此使用免费的在线测试ldap,并出现以下错误:

java.lang.AbstractMethodError: org.eclipse.jetty.jaas.JAASLoginService.login(Ljava/lang/String;Ljava/lang/Object;)Lorg/eclipse/jetty/server/UserIdentity; 
        at org.eclipse.jetty.security.authentication.LoginAuthenticator.login(LoginAuthenticator.java:61)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.security.authentication.BasicAuthenticator.validateRequest(BasicAuthenticator.java:92)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:512)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.server.Server.handle(Server.java:499)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[jetty-all-9.2.13.v20150730.jar:9.2.13.v20150730] 
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_101] 
请参阅myjetty.xml和login.conf配置部分并提出建议

登录配置

LDAPLogin { 
  org.apache.activemq.jaas.LDAPLoginModule required 
    debug=true 
    initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory 
    connectionURL="ldap://ldap.forumsys.com:389" 
    connectionUsername="cn=read-only-admin,dc=example,dc=com" 
    connectionPassword=password 
    connectionProtocol="" 
    authentication=simple 
    userBase="dc=example,dc=com" 
    userSearchMatching="(uid={0})" 
    userSearchSubtree=false 
    roleBase="dc=example,dc=com" 
    roleName=ou 
    roleSearchMatching="(ou=scientists)" 
    roleSearchSubtree=false 
    ; 
}; 
jetty.xml

<bean id="ldapLoginService" class="org.eclipse.jetty.jaas.JAASLoginService">
        <property name="name" value="LdapRealm" />
        <property name="loginModuleName" value="LDAPLogin" />
        <property name="roleClassNames" value="org.eclipse.jetty.jaas.JAASRole" />
        <property name="identityService" ref="identityService" />
    </bean>

<bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
        <property name="name" value="BASIC" />
        <property name="roles" value="scientists" />

        <property name="authenticate" value="true" />
    </bean>

<bean id="securityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
        <property name="loginService" ref="ldapLoginService" />
        <property name="identityService" ref="identityService" />
        <property name="realmName" value="LdapRealm" />
        <property name="authenticator">
            <bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator" />
        </property>
        <property name="constraintMappings">
            <list>
                <ref bean="adminSecurityConstraintMapping" />
                <ref bean="securityConstraintMapping" />
            </list>
        </property>
        <property name="handler" ref="secHandlerCollection" />
    </bean>

java.lang.AbstractMethodError表示正在调用抽象方法。码头的JAAS模块可能未启用;这意味着JAAS相关的JAR在类路径中不可用。请参阅下面关于启用JAAS模块的链接中的步骤3


java.lang.AbstractMethodError表示正在调用抽象方法。码头的JAAS模块可能未启用;这意味着JAAS相关的JAR在类路径中不可用。请参阅下面关于启用JAAS模块的链接中的步骤3