[kepler-dev] Kepler - bug related to user.home settings

Michal Owsiak michal.owsiak at man.poznan.pl
Thu May 24 04:25:16 PDT 2012


Hello Kepler team,

it looks like Kepler has a bug in Run.java file.

In this description I refer to Kepler 2.2 - as I have patch for this 
version.

At the moment it is not possible to spawn Kepler with custom HOME 
location. This is due to bug in file:

./build-area/src/org/kepler/build/Run.java

Inside this file new Java process is spawn. However, user.home property 
is not correctly passed to this sub-process. That means, even though 
user executes Kepler following way:

java -D"user.home"="$USER_HOME/kepler_local" -classpath 
$KEPLER/build-area/lib/ant.jar:$KEPLER/kepler.jar 
org.kepler.build.runner.Kepler

these settings are not passed to new process and new Java process uses 
original $HOME location instead of location specified by -Duser.home - 
in that case

-D"user.home"="$USER_HOME/kepler_local"

To make it possible to run Kepler in custom HOME locations, one must 
update Run.java with the patch attached to the e-mail.

As soon as I test this solution for trunk version I will post the 
message to the group with proper patch.

Why this bug exists:

Java Virtual Machine doesn't use $HOME environment variable to set 
user.home. Instead it gets it from system directly. Each new Java 
Virtual Machine must be provided with user.home variable set in order to 
change default settings.

Regards

Michal

-- 
Michal Owsiak <michal.owsiak at man.poznan.pl>

Institute of Bioorganic Chemistry PAS
Poznan Supercomputing and Networking Center
Noskowskiego 12/14, 61-704 Poznan, POLAND

http://www.man.poznan.pl
-------------- next part --------------
--- kepler/build-area/src/org/kepler/build/Run.java	2011-07-07 09:18:05.000000000 +0200
+++ kepler_4.09a/build-area/src/org/kepler/build/Run.java	2012-05-24 10:57:50.000000000 +0200
@@ -193,6 +193,7 @@
             jvmMaxMemory = MemoryProperties.getMaxMemory();
         
         System.out.println("JVM Memory = " + jvmMinMemory + " " + jvmMaxMemory);
+	System.out.println("User home: " + System.getProperty("user.home"));
 
 
         //If they are running "ant run-workflow" or "ant run-workflow-w/gui" do a quick sanity check and make sure the workflow file the specified exists."
@@ -269,6 +270,7 @@
         }
         java.createJvmarg().setLine("-Xmx" + jvmMaxMemory);
         java.createJvmarg().setLine("-Xss" + jvmMinMemory);
+        java.createJvmarg().setLine("-Duser.home=" + System.getProperty("user.home"));
         if (System.getProperty("os.name").equals("Mac OS X"))
         {
             String commonModuleName = ModuleTree.instance().getModuleByStemName("common").getName();
@@ -498,8 +500,10 @@
         java.setClassname(main);
         java.createJvmarg().setLine("-Xmx" + jvmMaxMemory);
         java.createJvmarg().setLine("-Xss" + jvmMinMemory);
+        java.createJvmarg().setValue("-Duser.home=\"" + System.getProperty("user.home") + "\""); 
+        System.out.println("User home: " + System.getProperty("user.home"));
         System.out.println("LD_LIBRARY_PATH: " + System.getenv("LD_LIBRARY_PATH"));
-        java.createJvmarg().setLine("-Djava.library.path=\"" + System.getenv("LD_LIBRARY_PATH"));
+        java.createJvmarg().setValue("-Djava.library.path=\"" + System.getenv("LD_LIBRARY_PATH") + "\"");
         handleRunProperties(java);
         java.createArg().setLine(args);
 


More information about the Kepler-dev mailing list