[英]ActiveMQ jndi.properties java.naming.referral
ActiveMQ's LDAPLoginModule doesn't like the LDAP searchResRef generated by my AD server when searching the root of the LDAP tree. 当搜索LDAP树的根目录时,ActiveMQ的LDAPLoginModule不喜欢我的AD服务器生成的LDAP searchResRef。 It generates (a swallowed): 它产生(吞咽):
NamingException javax.naming.PartialResultException: Unprocessed Continuation Reference(s); NamingException javax.naming.PartialResultException:未处理的延续参考;
I need to set the java.naming.referral
property to follow
. 我需要将java.naming.referral
属性设置为follow
。 I can change the source by adding: 我可以通过添加以下内容来更改源:
env.put(Context.REFERRAL, "follow"); env.put(Context.REFERRAL,“ follow”);
But, is there a way to use the mystical (to my C# brain) jndi.properties file to avoid a recompile? 但是,有没有办法使用神秘的(对我的C#大脑来说) jndi.properties文件来避免重新编译?
The command line used to start the process: 用于启动该过程的命令行:
/usr/bin/java -Xms256M -Xmx256M
-Dorg.apache.activemq.UseDedicatedTaskRunner=true
-Djava.util.logging.config.file=logging.properties
-Djava.security.auth.login.config=/root/apache-activemq-5.5.0/conf/login.config
-Dcom.sun.management.jmxremote
-Dactivemq.classpath=/root/apache-activemq-5.5.0/conf;
-Dactivemq.home=/root/apache-activemq-5.5.0
-Dactivemq.base=/root/apache-activemq-5.5.0
-jar /root/apache-activemq-5.5.0/bin/run.jar start
The bit of existing code I want to influence (isLoginPropertySet and getLDAPPropertyValue just read from an ActiveMQ config file - login.config in the above commandline): 我想影响的现有代码(isLoginPropertySet和getLDAPPropertyValue只是从ActiveMQ配置文件-上述命令行中的login.config中读取):
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, getLDAPPropertyValue(INITIAL_CONTEXT_FACTORY));
if (isLoginPropertySet(CONNECTION_USERNAME)) {
env.put(Context.SECURITY_PRINCIPAL, getLDAPPropertyValue(CONNECTION_USERNAME));
}
if (isLoginPropertySet(CONNECTION_PASSWORD)) {
env.put(Context.SECURITY_CREDENTIALS, getLDAPPropertyValue(CONNECTION_PASSWORD));
}
env.put(Context.SECURITY_PROTOCOL, getLDAPPropertyValue(CONNECTION_PROTOCOL));
env.put(Context.PROVIDER_URL, getLDAPPropertyValue(CONNECTION_URL));
env.put(Context.SECURITY_AUTHENTICATION, getLDAPPropertyValue(AUTHENTICATION));
context = new InitialDirContext(env);
Yes, just put java.naming.referral=follow
into a text file named jndi.properties
and locate that in the root directory of your JAR file. 是的,只需将java.naming.referral=follow
放入名为jndi.properties
的文本文件中,然后将其放在您的JAR文件的根目录中即可。
To add to a jar file: 要添加到jar文件中:
jar -uf run.jar jndi.properties
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.