[
https://jira.jboss.org/jira/browse/JBAS-6089?page=com.atlassian.jira.plug...
]
Jimmy Wilson updated JBAS-6089:
-------------------------------
Summary: Disable Client Auto-Discovery By Default (was: Can not
disable autodiscovery if System.setProperty() is used)
Issue Type: Feature Request (was: Bug)
Workaround Description: (was: Use InitialContext(Hashtable<?,?>))
Description: Client side auto-discovery is enabled by default, and in
certain situations this can cause confusion. It should be disabled by default in or to
avoid the unexpected use of other JBoss instances JNDI when a URL is provided. (was: If a
InitialContext is created via new InitialContext() and the properties are set via
System.setProperty(...) the autodiscovery can not be disabled.
Here the JUnitTest method:
public void checkSystemPropertiesConnection() throws NamingException {
System.setProperty("java.naming.factory.initial",
"org.jboss.naming.NamingContextFactory");
System.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
// System.setProperty("java.naming.provider.url",
"jnp://localhost:1099");
System.setProperty("jnp.disableDiscovery", "true");
InitialContext ctx = new InitialContext();
LOGGER.debug("JNDI properties: "+ctx.getEnvironment());
}
------------------------------ The Log output
16:01:28,497 DEBUG [de.wfink.ejb21.ConnectionTest] JNDI properties: {jnp.parsedName=,
java.naming.provider.url=padwfink1:1099,
java.naming.factory.initial=org.jboss.naming.NamingContextFactory,
jnp.disableDiscovery=false,
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces}
16:01:29,481 DEBUG [org.jnp.interfaces.NamingContext] Failed to connect to padwfink1:1099
----------------------------
If a lookup is started with this InitialContext autodiscovery is started.
If all is set in a HashTable and InitialContext(hashTable) is call it works
)
Assignee: Brian Stansberry (was: Jimmy Wilson)
Priority: Minor (was: Major)
Disable Client Auto-Discovery By Default
----------------------------------------
Key: JBAS-6089
URL:
https://jira.jboss.org/jira/browse/JBAS-6089
Project: JBoss Application Server
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: Naming
Affects Versions: JBossAS-4.2.2.GA, JBossAS-5.0.0.CR1, JBossAS-4.2.3.GA
Reporter: Wolf-Dieter Fink
Assignee: Brian Stansberry
Priority: Minor
Client side auto-discovery is enabled by default, and in certain situations this can
cause confusion. It should be disabled by default in or to avoid the unexpected use of
other JBoss instances JNDI when a URL is provided.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira