4.2.4 java_hras
The java_hras subcommand runs Java application programs that do not work with Application Server.
Synopsis
java_hras [options] class [argument...] java_hras [options] -jar file.jar [argument...]
Storage location
Application Server installation directory/jdk/jre/bin/
Function
The java_hras subcommand starts the Java VM in a state in which the stand-alone Java program execution functionality is enabled, and then executes the Java application. If the stand-alone Java program execution functionality is enabled, the proprietary functionality required for troubleshooting is also enabled.
If the java_hras command is executed with the value ON or OFF, which are options for the proprietary functionality required for troubleshooting, that specified value takes priority. If the same option is specified more than once, then the last-specified option is used.
The following table lists the options that are enabled when the stand-alone Java program execution functionality is used.
No. |
Category |
Option |
Java VM default value |
When the stand-alone Java program execution functionality is enabled |
---|---|---|---|---|
1 |
Java VM log output |
HitachiVerboseGC |
OFF |
ON |
2 |
HitachiOutputMilliTime |
OFF |
ON |
|
3 |
HitachiOutOfMemoryStackTrace |
OFF |
ON |
|
4 |
HitachiJavaClassLibTrace |
OFF |
ON |
|
5 |
Thread dumping output |
HitachiLocalsInStackTrace |
OFF |
ON |
6 |
HitachiLocalsSimpleFormat |
OFF |
ON |
|
7 |
HitachiOutOfMemoryAbort |
OFF |
ON |
|
8 |
Memory dump |
HitachiFullCore |
OFF |
ON |
When a Java command is executed, the following are different depending on whether the stand-alone Java program execution functionality is enabled.
-
Stack trace
When a Java program is executed, stack trace information that corresponds to the main thread of the Java program is different depending on whether the stand-alone Java program execution functionality is used.
-
You cannot specify the -Xhras option for the java_hras subcommand.
Other than the functionality listed above, the specification for the java command is the same as when the stand-alone Java program execution functionality is not used.
Arguments
Options that can be specified are the same as the java command. However, the -Xhras option cannot be specified by itself.
- options
-
Specifies the command-line options.
- class
-
Specifies the name of the class to be invoked.
- -jar file.jar
-
Specifies the name of the JAR file that will be called.
- argument
-
Specifies the arguments passed to the main function.
Output example
Example 1
When the stack trace information of the main thread is obtained by thread-dump output.
-
If the stand-alone Java program execution functionality is used:
main #1 prio=5 os_prio=0 jid=<N/A> tid=0x000000000230a800 nid=0x1988 waiting on condition [0x000000000282e000..0x000000000282fbc0] java.lang.Thread.State: TIMED_WAITING (sleeping) stack=[0x0000000002830000..0x0000000002734000..0x0000000002731000..0x0000000002730000] [user cpu time=218ms, kernel cpu time=46ms] [blocked count=0, waited count=0] at java.lang.Thread.sleep(Native Method) at Hoge.main(Hoge.java:5) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at JP.co.Hitachi.soft.jvm.tools.Java_hras.execJava(Java_hras.java:52) at JP.co.Hitachi.soft.jvm.tools.Java_hras.main(Java_hras.java:39)
-
If the stand-alone Java program execution functionality is not used:
"main" #1 prio=5 os_prio=0 jid=<N/A> tid=0x00000000002b7800 nid=0x1fa0 waiting on condition [0x000000000278f000..0x000000000278f9c0] java.lang.Thread.State: TIMED_WAITING (sleeping) stack=[0x0000000002790000..0x0000000002694000..0x0000000002691000..0x0000000002690000] [user cpu time=171ms, kernel cpu time=46ms] [blocked count=0, waited count=0] at java.lang.Thread.sleep(Native Method) at Hoge.main(Hoge.java:5)
Example 2
While executing the main method of the main class that was specified during startup, a java.lang.Exception exception error occurred which could not be caught in the main method.
-
If the stand-alone Java program execution functionality is used:
Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at JP.co.Hitachi.soft.jvm.tools.Java_hras.execJava(Java_hras.java:51) at JP.co.Hitachi.soft.jvm.tools.Java_hras.main(Java_hras.java:38) Caused by: java.lang.Exception: java.lang.Throwable at Test.main(Test.java:6) ... 6 more Caused by: java.lang.Throwable ... 7 more
-
If the stand-alone Java program execution functionality is not used:
Exception in thread "main" java.lang.Exception: java.lang.Throwable at Test.main(Test.java:6) Caused by: java.lang.Throwable ... 1 more
Exit Status
Same as the java command.
Notes
To run the java command, use the following methods:
-
Use the Application Server installation directory/jdk/jre/bin/java_hras command.
-
Use the java command in the specified -Xhras option.
-
When executing the java command, set the JAVA_HRAS environment variable.
When the java command is executed by other methods, the command execution fails and the following message is displayed:
Java command cannot be used except in some special cases. When starting a Java program, use the java_hras command, etc.
Depending on the Java program being run, it might be necessary to purchase the other product.
To run the javaw subcommand, use the following methods:
-
Use the javaw subcommand in the specified -Xhras option.
-
When executing the javaw command, set the JAVAW_HRAS environment variable.
When the javaw command is executed by other methods, the command execution fails and the following message is displayed:
Javaw command cannot be used except in some special cases. When starting a Java program, use the java_hras command, etc.
Depending on the Java program being run, it might be necessary to purchase the other product.