-
1. jConsole
wdfink Mar 10, 2011 9:57 AM (in response to zzpprk)If you start with bin/run.sh (Unix) the bin/run.conf is the right place.
But BTW you might start jconsole <PID> without having a remote connection
-
2. Re: jConsole
zzpprk Mar 10, 2011 10:16 AM (in response to wdfink)Thanks. I know nothing about Unix so I am guessing here. Please confirm.
Do I have to put the lines I mentioned above after the lines that say "-classpath "$JBOSS_CLASSPATH" \" in that file? Please find the run.sh file attached.
Regards
-
run.sh 8.2 KB
-
-
3. jConsole
jesse.hazen Mar 10, 2011 11:52 AM (in response to zzpprk)No, put them in run.conf at the end of the line starting with "if [ "x$JAVA_OPTS" = "x" ]" (if you are using unix/linux). So, it may look like:
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=8999"
fi
Then you can connect up remotely to this machine from jconsole. Like Wolf-Dieter mentioned, though, if you are using jconsole on the same box, you don't need to add these lines. If you start jconsole it will list the java processes you can connect to locally.
-
4. jConsole
jesse.hazen Mar 10, 2011 12:05 PM (in response to jesse.hazen)You don't want to be editing the run.sh file, it is used to start JBoss. run.conf is the configuration, so if you need to edit the JBoss startup parameters, you want to edit run.conf normally. You shouldnt really need to edit run.sh as it will read run.conf and use the configuration you've set there when starting JBoss.
-
5. jConsole
wdfink Mar 10, 2011 1:06 PM (in response to jesse.hazen)If you want to add the parameter in every case you should use add line like:
JAVA_OPTS="$JAVA_OPTS -Dcom.sun........"
because otherwise the option is only added if you did not set JAVA_OPTS before starting the script.
We change run.conf and set JAVA_OPTS in every case to avoid confusing behaviour depends to the environment
-
6. Re: jConsole
zzpprk Mar 15, 2011 5:29 AM (in response to jesse.hazen)if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=8999"
fi
What is this if clause all about. Shouldn't I set thgese options outsdide the if?
-
7. jConsole
wdfink Mar 15, 2011 6:15 AM (in response to zzpprk)The reason of the 'if' statement is that you might able to set different JAVA_OPTS before running run.sh.
For our application we remove it because we want not to set it different by accident.
-
8. Re: jConsole
jesse.hazen Mar 15, 2011 11:30 AM (in response to zzpprk)I just pasted some of the code from the run.conf for 5.1.0 out of the box. You can add those entries inside or outside the if clause.
You could do it outside the if clause, like:
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"
fi
## Specify the Security Manager options
#JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$POLICY"
# Sample JPDA settings for remote socket debugging
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dsun.management.jmxremote.port=12345"
# Sample JPDA settings for shared memory debugging
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,address=jboss,server=y,suspend=n"
The point is that this file is where the JAVA_OPTS variable is configured, so you will want to add the JVM arguments in this file.