Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6937753

mvm-on: java -XUseMServer still returns exit code 0 when application throws exception

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: mvm-7
    • Fix Version/s: mvm-hs16
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      team
    • CPU:
      generic
    • OS:
      generic

      Description

      If application throws exception, the exit code is always 0 (1 is expected).

      To reproduce, compile and run this program with -XUseMserver:

      $ java -XUseMServer -cp /tmp/t Main; echo $?
      Exception in thread "main"
      java.lang.RuntimeException: An exception
              at Main.main(Main.java:3)
      0


      public class Main {
              public static void main(String[] args) {
                      throw new RuntimeException("An exception");
              }
      }

      or use non-existing class:
      java -XUseMServer NonExistingClass;echo $?
      Exception in thread "main"
      java.lang.NoClassDefFoundError: NonExistingClass
      Caused by: java.lang.ClassNotFoundException: NonExistingClass
              at java.net.URLClassLoader$1.run(URLClassLoader.java:299)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:288)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:287)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:429)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:328)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
      0

        Attachments

          Activity

            People

            • Assignee:
              coleenp Coleen Phillimore
              Reporter:
              nhaustov Nicolay Haustov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: