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

Michal Owsiak michal.owsiak at man.poznan.pl
Fri May 25 01:21:28 PDT 2012


Hello Matt,

I have prepared patch for the trunk version. File is attached to the e-mail.

I have tested it with most recent Kepler version (trunk version from SVN).

I hope you will find it useful and will incorporate it into main release.

To apply it, simply execute:

patch Run.java < Run.java.trunk.patch

inside

kepler/build-area/src/org/kepler/build

Regards

Michal

> Michal,
>
> This change looks fairly innocuous and seems to be a reasonable change.
> Thanks.  Please let us know how your testing against trunk goes, and if it
> goes well, it seems reasonable to commit it so that it can be part of the
> Kepler 2.4 release.
>
> Matt
>
> On Thu, May 24, 2012 at 3:25 AM, Michal Owsiak
> <michal.owsiak at man.poznan.pl>wrote:
>
>> 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
>>
>> _______________________________________________
>> Kepler-dev mailing list
>> Kepler-dev at kepler-project.org
>> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>>
>>
>


-- 
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 --------------
--- Run.java.old	2012-05-25 08:55:36.000000000 +0200
+++ Run.java	2012-05-25 09:54:41.000000000 +0200
@@ -281,6 +281,10 @@
         }
         java.createJvmarg().setLine("-Xmx" + jvmMaxMemory);
         java.createJvmarg().setLine("-Xms" + jvmMinMemory);
+
+	// Pass user.home to sub-process
+	java.createJvmarg().setLine("-Duser.home=" + System.getProperty("user.home")); 
+
         if ( System.getProperty("os.name").equals("Mac OS X") && main.equals(DEFAULT_MAIN) && workflow.equals("") )
         {
             String commonModuleName = ModuleTree.instance().getModuleByStemName("common").getName();
@@ -509,6 +513,9 @@
         java.createJvmarg().setLine("-Xmx" + jvmMaxMemory);
         java.createJvmarg().setLine("-Xms" + jvmMinMemory);
 
+	// Pass user.home to sub-process
+        java.createJvmarg().setLine("-Duser.home=" + System.getProperty("user.home"));
+
         handleRunProperties(java);
         java.createArg().setLine(args);
 


More information about the Kepler-dev mailing list