[jboss-jira] [JBoss JIRA] Commented: (JBAS-5240) log $JAVA_OPTS in boot.log, by setting the 'jboss.java.opts' environment variable at start-up

Galder Zamarreno (JIRA) jira-events at lists.jboss.org
Wed Feb 18 07:33:44 EST 2009


    [ https://jira.jboss.org/jira/browse/JBAS-5240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12453065#action_12453065 ] 

Galder Zamarreno commented on JBAS-5240:
----------------------------------------

Think I found a way to show these VM parameters in boot.log:

java.lang.management.RuntimeMXBean.getInputArguments();

Returns the input arguments passed to the Java virtual machine which does not include the arguments to the main method. This method returns an empty list if there is no input argument to the Java virtual machine.

Some Java virtual machine implementations may take input arguments from multiple different sources: for examples, arguments passed from the application that launches the Java virtual machine such as the 'java' command, environment variables, configuration files, etc.

Typically, not all command-line options to the 'java' command are passed to the Java virtual machine. Thus, the returned input arguments may not include all command-line options.

    MBeanServer access:
    The mapped type of List is String[].

    Returns:
        a list of String objects; each element is an argument passed to the Java virtual machine. 
    Throws:
        SecurityException - if a security manager exists and the caller does not have ManagementPermission("monitor").

This is what JConsole uses to show the VM parameters in sun.tools.jconsole.SummaryTab. Sample:


VM Information
Java Virtual Machine: 
Java HotSpot(TM) Server VM version 1.5.0_16-b02
Vendor: 
Sun Microsystems Inc.
Uptime: 
6 minutes
Name: 
17358 at localhost.localdomain
VM arguments: 
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/java_heap -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=21001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dfile.encoding=UTF-8 

> log $JAVA_OPTS in boot.log, by setting the 'jboss.java.opts' environment variable at start-up
> ---------------------------------------------------------------------------------------------
>
>                 Key: JBAS-5240
>                 URL: https://jira.jboss.org/jira/browse/JBAS-5240
>             Project: JBoss Application Server
>          Issue Type: Task
>      Security Level: Public(Everyone can see) 
>          Components: Other
>    Affects Versions: JBossAS-4.2.2.GA, JBossAS-5.0.0.Beta4
>            Reporter: Galder Zamarreno
>            Assignee: Galder Zamarreno
>            Priority: Critical
>             Fix For: JBossAS-5.1.0.GA, JBossAS-6.0.0.Alpha1
>
>
> To help remote support, AS should by default log command line options 
> within boot.log as explained in " Logging command line options in boot.log" 
> section in http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossBootLogging
> Thoughts?

-- 
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