Uploaded image for project: 'Commons Daemon'
  1. Commons Daemon
  2. DAEMON-165

Uncaught exceptions in main methods are being obscured

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.2, 1.0.3
    • 1.0.4
    • Procrun
    • None
    • Procrun running on windows with any java release

    Description

      Inside the__apxJavaWorkerThread method in javajni.c the following line just after the call to execute the main method:

      JVM_EXCEPTION_CLEAR(lpJava);

      is making any uncaught exception in the main method simply disappear. This can make diagnoising startup and/or shutdown issues in applications over which you have no direct control (ie third party apps for which you dont have sourcecode). I had this where a classpath error was causing some issues and later some other exceptions, all were completely hidden until I removed this line.

      Two solutions I believe are possible.

      1) Simply remove this line, the VM will then handle the exception by outputting it to standard error in which case it will appear in the service stderr log file.

      2) Check for and then obtain any exception and log appropriately

      The second would give greater control to procrun and be more prominant in the main log rather than the stderr logs.

      Attachments

        Activity

          People

            Unassigned Unassigned
            antonyscerri Antony Scerri
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: