[jboss-jira] [JBoss JIRA] Created: (JBAS-6089) Can not disable autodiscovery if System.setProperty() is used
Wolf-Dieter Fink (JIRA)
jira-events at lists.jboss.org
Tue Oct 14 10:12:25 EDT 2008
Can not disable autodiscovery if System.setProperty() is used
-------------------------------------------------------------
Key: JBAS-6089
URL: https://jira.jboss.org/jira/browse/JBAS-6089
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Naming
Affects Versions: JBossAS-4.2.3.GA, JBossAS-5.0.0.CR1, JBossAS-4.2.2.GA
Reporter: Wolf-Dieter Fink
Assignee: Scott M Stark
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
--
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
More information about the jboss-jira
mailing list