This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git
The following commit(s) were added to refs/heads/master by this push:
new 2ca251f Log the error code if JVM creation fails.
2ca251f is described below
commit 2ca251f7ce31c83604036eee8a222a2881f850d7
Author: Mark Thomas <[email protected]>
AuthorDate: Thu May 9 09:50:14 2019 +0100
Log the error code if JVM creation fails.
---
src/changes/changes.xml | 4 ++++
src/native/windows/src/javajni.c | 8 +++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 060c560..d96a514 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -79,6 +79,10 @@
Procrun. Ensure that JAVA_HOME/bin is on the path when running in jvm
mode so that additional DLLs, such as awt.dll, can be found if
required.
</action>
+ <action type="add" dev="markt">
+ Procrun. Log the error code returned if JVM creation fails to aid
+ debugging.
+ </action>
</release>
<release version="1.1.0" date="2017-11-15" description="Feature and bug
fix release">
<action issue="DAEMON-368" type="add" dev="ggregory">
diff --git a/src/native/windows/src/javajni.c b/src/native/windows/src/javajni.c
index 256a812..119689d 100644
--- a/src/native/windows/src/javajni.c
+++ b/src/native/windows/src/javajni.c
@@ -693,6 +693,7 @@ apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
else {
CHAR iB[3][64];
LPSTR szCp = NULL;
+ int result;
lpJava->iVersion = JNI_VERSION_DEFAULT;
if (dwMs)
++sOptions;
@@ -759,10 +760,11 @@ apxJavaInitialize(APXHANDLE hJava, LPCSTR szClassPath,
vmArgs.nOptions = nOptions;
vmArgs.version = lpJava->iVersion;
vmArgs.ignoreUnrecognized = JNI_FALSE;
- if (DYNLOAD_FPTR(JNI_CreateJavaVM)(&(lpJava->lpJvm),
+ result = DYNLOAD_FPTR(JNI_CreateJavaVM)(&(lpJava->lpJvm),
(void **)&(lpJava->lpEnv),
- &vmArgs) != JNI_OK) {
- apxLogWrite(APXLOG_MARK_ERROR "CreateJavaVM Failed");
+ &vmArgs);
+ if (result != JNI_OK) {
+ apxLogWrite(APXLOG_MARK_ERROR "CreateJavaVM Failed with error
[%d]", result);
rv = FALSE;
}
else {