Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 49772 invoked from network); 2 Oct 2010 09:24:28 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Oct 2010 09:24:28 -0000 Received: (qmail 4417 invoked by uid 500); 2 Oct 2010 09:24:28 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 4069 invoked by uid 500); 2 Oct 2010 09:24:25 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 4062 invoked by uid 99); 2 Oct 2010 09:24:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Oct 2010 09:24:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Oct 2010 09:24:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 343F223889CB; Sat, 2 Oct 2010 09:24:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1003757 - in /commons/proper/daemon/trunk: RELEASE-NOTES.txt src/native/windows/src/javajni.c Date: Sat, 02 Oct 2010 09:24:00 -0000 To: commits@commons.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101002092400.343F223889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mturk Date: Sat Oct 2 09:23:58 2010 New Revision: 1003757 URL: http://svn.apache.org/viewvc?rev=1003757&view=rev Log: DAEMON-165: Do not clear exceptions from main method. Also use always ExceptionDescribe, not only in DEBUG mode Modified: commons/proper/daemon/trunk/RELEASE-NOTES.txt commons/proper/daemon/trunk/src/native/windows/src/javajni.c Modified: commons/proper/daemon/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/RELEASE-NOTES.txt?rev=1003757&r1=1003756&r2=1003757&view=diff ============================================================================== --- commons/proper/daemon/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/daemon/trunk/RELEASE-NOTES.txt Sat Oct 2 09:23:58 2010 @@ -46,7 +46,7 @@ NEW FEATURES: BUG FIXES: -1.0.4: DAEMON-95, DAEMON-171, DAEMON-100 +1.0.4: DAEMON-95, DAEMON-171, DAEMON-100, DAEMON-165 1.0.3: DAEMON-108, DAEMON-128, DAEMON-139, DAEMON-143, DAEMON-148, DAEMON-135, DAEMON-155, DAEMON-159, DAEMON-161, DAEMON-145, DAEMON-146, Modified: commons/proper/daemon/trunk/src/native/windows/src/javajni.c URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/src/javajni.c?rev=1003757&r1=1003756&r2=1003757&view=diff ============================================================================== --- commons/proper/daemon/trunk/src/native/windows/src/javajni.c (original) +++ commons/proper/daemon/trunk/src/native/windows/src/javajni.c Sat Oct 2 09:23:58 2010 @@ -63,7 +63,6 @@ static DYNLOAD_FPTR_DECLARE(SetDllDirect #define JVM_EXCEPTION_CHECK(jvm) \ ((*((jvm)->lpEnv))->ExceptionCheck((jvm)->lpEnv) != JNI_OK) -#ifdef _DEBUG #define JVM_EXCEPTION_CLEAR(jvm) \ APXMACRO_BEGIN \ if ((jvm)->lpEnv) { \ @@ -72,15 +71,6 @@ static DYNLOAD_FPTR_DECLARE(SetDllDirect (*((jvm)->lpEnv))->ExceptionClear((jvm)->lpEnv); \ } \ } APXMACRO_END -#else -#define JVM_EXCEPTION_CLEAR(jvm) \ - APXMACRO_BEGIN \ - if ((jvm)->lpEnv) { \ - if ((*((jvm)->lpEnv))->ExceptionCheck((jvm)->lpEnv)) { \ - (*((jvm)->lpEnv))->ExceptionClear((jvm)->lpEnv); \ - } \ - } APXMACRO_END -#endif #define JNI_LOCAL_UNREF(obj) \ (*(lpJava->lpEnv))->DeleteLocalRef(lpJava->lpEnv, obj) @@ -843,10 +833,10 @@ static DWORD WINAPI __apxJavaWorkerThrea LPAPXJAVAVM lpJava; LPAPXJAVA_THREADARGS pArgs = (LPAPXJAVA_THREADARGS)lpParameter; APXHANDLE hJava; - + hJava = (APXHANDLE)pArgs->hJava; if (hJava->dwType != APXHANDLE_TYPE_JVM) - WORKER_EXIT(0); + WORKER_EXIT(1); if (!apxJavaInitialize(pArgs->hJava, pArgs->szClassPath, @@ -878,15 +868,16 @@ static DWORD WINAPI __apxJavaWorkerThrea lpJava->clWorker.jClazz, lpJava->clWorker.jMethod, lpJava->clWorker.jArgs); - - JVM_EXCEPTION_CLEAR(lpJava); - __apxJvmDetach(lpJava); - apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread %s:%s finished", - lpJava->clWorker.sClazz, lpJava->clWorker.sMethod); + if (JVM_EXCEPTION_CHECK(lpJava)) { + WORKER_EXIT(4); + } + else { + __apxJvmDetach(lpJava); + } finished: lpJava->dwWorkerStatus = 0; - apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread finished %s:%s", - lpJava->clWorker.sClazz, lpJava->clWorker.sMethod); + apxLogWrite(APXLOG_MARK_DEBUG "Java Worker thread finished %s:%s with status=%d", + lpJava->clWorker.sClazz, lpJava->clWorker.sMethod, rv); ExitThread(rv); /* never gets here but keep the compiler happy */ return 0;