Uncaught exceptions in main methods are being obscured
------------------------------------------------------

                 Key: DAEMON-165
                 URL: https://issues.apache.org/jira/browse/DAEMON-165
             Project: Commons Daemon
          Issue Type: Bug
          Components: Procrun
    Affects Versions: 1.0.2
         Environment: Procrun running on windows with any java release
            Reporter: Antony Scerri


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to