|
From: Leif M. <lei...@ta...> - 2012-10-29 05:57:49
|
Michael, The Warning you are seeing when you replace java.exe with a bat file is intentional. We used to be more flexible there but had a few users who were doing something similar to you and running into problems. The Wrapper expects that it is launching java directly and then monitors that process until it exits. When a bat or sh file is used, they sometimes will launch the JVM in the background and then exit. This was causing the Wrapper to think the JVM exited and for it to be restarted. If it is necessary to take actions before launching a JVM, then we recommend using the jvm_prelaunch event to execute a command before the Wrapper launches the JVM. http://wrapper.tanukisoftware.com/doc/english/props-event.html It sounds like you have everything working. Let me know if we can be of further assistance Cheers, Leif On Thu, Oct 25, 2012 at 7:20 AM, Michael MacFaden <mr...@vm...> wrote: > Thanks Leif, quite helpful. > > > So here's what I have now. > > > c:\type myapp-startup.bat > > .... > rem The base name for the Wrapper binary. > set _WRAPPER_BASE=vws-wrapper > > rem The name and location of the Wrapper configuration file. This will > be used > rem if the user does not specify a configuration file as the first > argument to > rem this script. > set _WRAPPER_CONF_DEFAULT=../conf/vws-wrapper.conf > > rem Note that it is only possible to pass parameters through to the JVM > when > rem installing the service, or when running in a console. > > # setup VM's memory settings, variables picked up by > ../conf/vww-wrapper.conf > # see https://wiki.eng.vmware.com/CloudVM/Sizing > # APP_NAME must match entry in vws-wrapper.conf > set APP_NAME=vmware-vws > if not defined VMWARE_JAVA_HOME exit 2 > if not defined VMWARE_CLOUDVM_RAM_SIZE exit 3 > if not defined VMWARE_LOG_DIR exit 4 > > set JAVA_HOME=%VMWARE_JAVA_HOME% > set /a MAXMEM_VALUE=0 > set /a MINMEM_VALUE=0 > set /a VAR=0 > set size_cmd='"%VMWARE_CLOUDVM_RAM_SIZE%" %APP_NAME%' > for /f %%A in (%size_cmd%) do ( > set /a VAR=%%A > ) > set /a MAXMEM_VALUE += %VAR% > if %MAXMEM_VALUE == 0 exit 5 > if %MINMEM_VALUE% == 0 set MINMEM_VALUE=16 > echo "'%APP_NAME%' is using a starting heap of %MINMEM_VALUE% and a max of > %MAXMEM_VALUE% mb > > rem Do not modify anything beyond this point > rem --------------------------------------------------- > .... > > > BTW, this warning was helpful was well since the design we were toying > with internally was not placing > wrapper.java.command=c:\some-wrapper-that-calls-java\script.bat > > And was seeing this: > > DEBUG | wrapper | 2012/10/24 14:35:51 | Waiting 5 seconds before > launching another JVM. > DEBUG | wrapper | 2012/10/24 14:35:56 | Magic number for file > vmware-vws.bat: 0x4072656d > WARN | wrapper | 2012/10/24 14:35:56 | The value of > wrapper.java.command does not appear to be a java binary. > WARN | wrapper | 2012/10/24 14:35:56 | The use of scripts is not > supported. Trying to continue, but some features may not work correctly.. > > Mike MacFaden > Staff Engineer, VMware , Palo Alto CA > > ------------------------------ > > Michael, > There are a number of ways to pass values into the Wrapper to do what you > want. The method you use will depend on the circumstances under which you > will be changing the memory size settings. > > 1) Environment variables. > http://wrapper.tanukisoftware.com/doc/english/props-envvars.html > It is possible to reference any environment variable from within your > wrapper.conf file. These values of course will only work when the > environment is loaded. This means that if you change the environment > (SYSTEM in most cases) you will need to restart the Wrapper service itself > for the changes to take affect. If you use environment variables, you do > so as follows: > > Environment: > > > -- Leif Mortenson Tanuki Software, Ltd. 6-16-7-1001 Nishi-Kasai, Edogawa-ku Tokyo 134-0088 Japan Tel: +81-3-3878-3211 Fax: +81-3-3878-0313 http://www.tanukisoftware.com lei...@ta... |