[
http://jira.jboss.com/jira/browse/JBAS-3637?page=all ]
Dimitris Andreadis updated JBAS-3637:
-------------------------------------
Summary: twiddle ignores environment properties when creating its
InitialContext (was: Way to set JNDI properties for twiddle)
Issue Type: Bug (was: Feature Request)
Component/s: Management services
Fix Version/s: JBossAS-5.0.0.CR1
JBossAS-4.2.3.GA
Affects Version/s: JBossAS-4.2.0.GA
Description:
The original feature request:
=======================================================================
It is frequently useful to be able to set JDNI properties when running twiddle - for
example,
you might want to set jnp.disableDiscovery when checking the status of a particular
server
that might not be running.
Right now, this is difficult to do. You can export a JBOSS_CLASSPATH
which contains a jndi.properties file before running twiddle.sh, but then you have to
include all the standard jars in it, which is quite annoying.
A pssible fixes would be one of:
A) A way to prepend elements to JBOSS_CLASSPATH without disabling the default
construction (also useful for getting a log4j.properties that doesn't drop
twiddle.log
in the cwd, perhaps)
B) A command line option for specifying a particular properties file to load and pass
to 'new InitialContext()' (slightly more convenient than A)
C) A command line option to define particular properties:
twiddle.sh -jnpProperty=jnp.disableDiscovery=true
(Or some better syntax)
The twiddle code actually does:
Properties props = new Properties(System.getProperties());
props.put(Context.PROVIDER_URL, serverURL);
ctx = new InitialContext(props);
In the case where a server URL is set, so there may have been intention that twiddle.sh
-Djnp.disableDiscovery=true
would work, but AFAIK property inheritance doesn't work in that place - only the
properties directly in props take
effect, and system properties won't be looked at in the other code path either.
===========================================================
The real problem is that twiddle ignores environment properties when creating its
InitialContext.
By fixing this you can just specify in the command line:
-Djnp.disableDiscovery
was:
It is frequently useful to be able to set JDNI properties when running twiddle - for
example,
you might want to set jnp.disableDiscovery when checking the status of a particular
server
that might not be running.
Right now, this is difficult to do. You can export a JBOSS_CLASSPATH
which contains a jndi.properties file before running twiddle.sh, but then you have to
include all the standard jars in it, which is quite annoying.
A pssible fixes would be one of:
A) A way to prepend elements to JBOSS_CLASSPATH without disabling the default
construction (also useful for getting a log4j.properties that doesn't drop
twiddle.log
in the cwd, perhaps)
B) A command line option for specifying a particular properties file to load and pass
to 'new InitialContext()' (slightly more convenient than A)
C) A command line option to define particular properties:
twiddle.sh -jnpProperty=jnp.disableDiscovery=true
(Or some better syntax)
The twiddle code actually does:
Properties props = new Properties(System.getProperties());
props.put(Context.PROVIDER_URL, serverURL);
ctx = new InitialContext(props);
In the case where a server URL is set, so there may have been intention that twiddle.sh
-Djnp.disableDiscovery=true
would work, but AFAIK property inheritance doesn't work in that place - only the
properties directly in props take
effect, and system properties won't be looked at in the other code path either.
twiddle ignores environment properties when creating its
InitialContext
-----------------------------------------------------------------------
Key: JBAS-3637
URL:
http://jira.jboss.com/jira/browse/JBAS-3637
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Management services
Affects Versions: JBossAS-4.2.0.GA
Reporter: Owen Taylor
Assigned To: Jimmy Wilson
Priority: Minor
Fix For: JBossAS-4.2.3.GA, JBossAS-5.0.0.CR1
The original feature request:
=======================================================================
It is frequently useful to be able to set JDNI properties when running twiddle - for
example,
you might want to set jnp.disableDiscovery when checking the status of a particular
server
that might not be running.
Right now, this is difficult to do. You can export a JBOSS_CLASSPATH
which contains a jndi.properties file before running twiddle.sh, but then you have to
include all the standard jars in it, which is quite annoying.
A pssible fixes would be one of:
A) A way to prepend elements to JBOSS_CLASSPATH without disabling the default
construction (also useful for getting a log4j.properties that doesn't drop
twiddle.log
in the cwd, perhaps)
B) A command line option for specifying a particular properties file to load and pass
to 'new InitialContext()' (slightly more convenient than A)
C) A command line option to define particular properties:
twiddle.sh -jnpProperty=jnp.disableDiscovery=true
(Or some better syntax)
The twiddle code actually does:
Properties props = new Properties(System.getProperties());
props.put(Context.PROVIDER_URL, serverURL);
ctx = new InitialContext(props);
In the case where a server URL is set, so there may have been intention that twiddle.sh
-Djnp.disableDiscovery=true
would work, but AFAIK property inheritance doesn't work in that place - only the
properties directly in props take
effect, and system properties won't be looked at in the other code path either.
===========================================================
The real problem is that twiddle ignores environment properties when creating its
InitialContext.
By fixing this you can just specify in the command line:
-Djnp.disableDiscovery
--
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