[JBoss JIRA] Created: (JBAS-6089) Can not disable autodiscovery if System.setProperty() is used
by Wolf-Dieter Fink (JIRA)
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
17 years, 4 months
[JBoss JIRA] Created: (JBAS-5581) Setting jgroups.bind_address or bind.address in run.conf will be ignored if -b used
by Galder Zamarreno (JIRA)
Setting jgroups.bind_address or bind.address in run.conf will be ignored if -b used
-----------------------------------------------------------------------------------
Key: JBAS-5581
URL: http://jira.jboss.com/jira/browse/JBAS-5581
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: JBossAS-5.0.0.Beta4, JBossAS-4.2.2.GA
Reporter: Galder Zamarreno
Assigned To: Galder Zamarreno
* Why it it useless specifying -Dbind.address=192.168.0.1 inside run.conf?
Why does it work only specifying it on command line?
For example:
If you set -Dbind.address=127.0.0.1 in run.conf and starting AS with:
./bin/run.sh -b 10.33.144.245
The value assigned to -Dbind.address will be ignored.
When you pass -Dbind.address in the command line, JBoss sets
both this system property and -Djgroups.bind_address to that value, which
means that if you pass -b after that, it won't override the given
-Dbind.address. Bottom line, if -Dbind.address set in command line before
-b, it's the winner. Example:
./bin/run.sh -Dbind.address=127.0.0.1 -b 1.2.3.4
-> JGroups will bind to 127.0.0.1
If you pass -b in the command line before -Dbind.address, -b will first
set -Dbind.address and -Djgroups.bind_address, but then, when
-Dbind.address is process, it will override the values of them two with
what was passed in -Dbind.address
./bin/run.sh -b 1.2.3.4 -Dbind.address=127.0.0.1
-> JGroups will bind to 127.0.0.1
Now, This does not happen when the -Dbind.address is set in run.conf
instead of command line. There's a bug here. When AS processes -b,
it checks whether -Dbind.address has been set, which it has, so leaves
it as it is. Now, when it checks -Djgroups.bind_address, it sees that it hasn't
been set, but *does not do a double check in case -Dbind.address has been set*,
so it ends up setting -Djgroups.bind_address to the value of -b, that way ignoring
the value you passed to -Dbind.address. Example:
run.conf with -Dbind.address=127.0.0.1
./bin/run.sh -b 1.2.3.4
-> JGroups will bind to 1.2.3.4
What's the fix? Add the double check in -b processing so that if -Dbind.address was
set by the user, AS does not take the value of -b and assign to -Djgroups.bind_addr
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 4 months