简体   繁体   English

ActiveMQ jndi.properties java.naming.referral

[英]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文件来避免重新编译?

More Info 更多信息

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.

相关问题 在jndi.properties中声明变量 - Declare variable in jndi.properties jndi.properties-如何设置? - jndi.properties - how to set it? TomEE配置问题,jndi.properties,NameNotFoundException - TomEE Config Problems , jndi.properties, NameNotFoundException 如何为DataStore设置jndi.properties? - How to set up jndi.properties for DataStore? 所有的jndi.properties属性名称是什么? - what are all the jndi.properties property names? 为什么在从jndi.properties注入后在JNDI中找不到数据源? - Why datasource is not found in JNDI after injection from jndi.properties? EJB + Web应用程序(JBoss 5)是否需要jndi.properties文件? - Is the jndi.properties file required for a EJB + web application (JBoss 5)? 在通过Eclipse Luna创建EJB 2.1项目时如何为Websphere 8.5编写jndi.properties - how to write jndi.properties for Websphere 8.5 when creating a EJB 2.1 project by eclipse Luna 我无法设置 jndi.properties 来访问 Jboss 5 上的远程 EJB - I can't setup my jndi.properties to access remote EJBs on Jboss 5 无法通过Spring的PropertyPlaceholderConfigurer设置JNDI属性(java.naming.factory.initial和java.naming.provider.url) - JNDI properties (java.naming.factory.initial & java.naming.provider.url) not getting set through Spring's PropertyPlaceholderConfigurer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM