Guest

Java Service Instalation

Hi.

what´s the right form to set JVM Parameters ?

I new to includ -D or not, thats a righ String for JVM parameters:
-Djava.rmi.server.codebase=file:/[TARGETDIR]/ -Djava.security.policy=[TARGETDIR]proxy.policy

I followed your pass to pass example to put a Java Application like a Service and got the following error when tried to install:
Service 'TESORGNProxy' (TesorJavaService.exe) could not be installed. Verify that you have suffient privileges to install system services.

I´m running the install wizard with an admin user.

Thankz
dorel
Posts: 25
Joined: Mon Oct 18, 2004 8:13 am

Hi,
The correct form to pass parameteres to JVM is : "-Dname=value". This is the correct form in case the value contains spaces (as [TARGETDIR] probably contains).
Dorel Pislan
Advanced Installer Team
http://www.advancedinstaller.com
Guest

dorel wrote:Hi,
The correct form to pass parameteres to JVM is : "-Dname=value". This is the correct form in case the value contains spaces (as [TARGETDIR] probably contains).
Thankz but

If I want to pass multiple JVM parametrs just separe it with blank space ?

Regards
dorel
Posts: 25
Joined: Mon Oct 18, 2004 8:13 am

Hi,
If you have several parameters you can separate them with spaces.
Dorel Pislan
Advanced Installer Team
http://www.advancedinstaller.com
bertc

JVM parameters problem

Hi,

I change the JVM parameter in <service>.ini, and found that AI's service launcher can not proper handle value contains space.

Virtual Machine Parameters="-Dname=valueok" (this is fine, startup normally)

however, I need this...

Virtual Machine Parameters="-Dname=value notok"

The service complains that the app. can not be started and no return error. I have used the double quote in this key.

In addition, I really need <ADD DIR> in Class Path setting, this is very common for java applications / services while not all resources are archived as JAR, configuration xml for example. Once the application has been deployed to different platforms, it can not use Windows Registry as config. I'm using 2.5.1..

Thanks

Regards,
Bert
dorel wrote:Hi,
If you have several parameters you can separate them with spaces.
UdreaMihai
Posts: 90
Joined: Wed Mar 23, 2005 8:13 am

Hello Bert,

We are unable to duplicate your problem. Our service works fine for parameter "-Dname=value notok".

Maybe there is a problem with your java program. Try to use a log file to see if it runs.

Best,
Mihai
Udrea Mihai
Advanced Installer Team
http://www.advancedinstaller.com
carvasd

JVM Parameters Error

HI I've the same error as Bert, the JVM Parameters works fine only if the parameter has NO spaces at all. I mean, the only way it works is:

Virtual Machine Parameters=-DPARAM_ONE=C:\Hello -DPARAM_TWO=C:\Hello

the folowing DO NOT work:

-DPARAM_ONE=C:\Hello World\temp -DPARAM_TWO=C:\Hello
-DPARAM_ONE=C:\Hello -DPARAM_TWO=C:\Hello World\temp
-DPARAM_ONE=C:\Hello -DPARAM_TWO="C:\Hello World\temp"
-DPARAM_ONE="C:\Hello World\temp" -DPARAM_TWO=value
-DPARAM_ONE="C:\Hello World\temp" -DPARAM_TWO="C:\Hello World\temp"
"-DPARAM_ONE="C:\Hello World\temp" -DPARAM_TWO="C:\Hello World\temp""
"-DPARAM_ONE="C:\Hello World\temp"" "-DPARAM_TWO="C:\Hello World\temp""
"-DPARAM_ONE=C:\Hello World\temp" "-DPARAM_TWO=C:\Hello World\temp"

these all generate a: JNI Exception: faile to create the JVM

could please please help us out, this feature is critical for us.

thanks!
carasd

JVM parameters

HEY! this one works too:

"-DPARAM_ONE=C:\Hello World" -DPARAM_TWO=C:\Hello

but these dont:

"-DPARAM_ONE=C:\Hello World" "-DPARAM_TWO=C:\Hello"
"-DPARAM_ONE=C:\Hello World -DPARAM_TWO=C:\Hello"
"-DPARAM_ONE=C:\Hello World" "-DPARAM_TWO=C:\Hello World"
"-DPARAM_ONE=C:\Hello World -DPARAM_TWO=C:\Hello World"


any help?
carvasd

JVM Parameters

I think I've answered my self, this sems to be the way:

Virtual Machine Parameters=""-PARAM_ONE=C:\Hello World" "-DPARAM_TWO=C:\Hello World""

thats it, double quotes, one for each parameter and one for the whole Parameters String... could someone confirm this please????
UdreaMihai
Posts: 90
Joined: Wed Mar 23, 2005 8:13 am

Hi,

Yes, this is a correct parameter format but, this format is used only in the INI file.
If you use the: "Java Product" page -> "JVM Parameters" edit box, you must not use those extra quotes. A valid entry in "JVM Parameters" edit box is:

"-DPARAM_ONE=C:\Hello World" "-DPARAM_TWO=C:\Hello World"

Where did you enter these parameters? In the "Java Products" page or directly in the INI file?

Best regards,
Mihai.
Udrea Mihai
Advanced Installer Team
http://www.advancedinstaller.com
Guest

i finally got my one param working.. i used the "custom action" method, but no matter what combination of quotes i used, the only one that doesnt give me a jni /jvm error is :

1) created a custom action and surrounded the param with 2 double-quotes..

""-Dxmlfile=[TARGETDIR]Settings.xml""

named my property name XMLFILE

2) i set 'Java Products'->'JVM Parameters' to [XMLFILE]

saved, built, and it worked. same concept as manually editing the ini file, however, if you define your property name in the custom action with double quotes, as in:

"-Dxmlfile=[TARGETDIR]Settings.xml"

and then try and enclose your JVM Parameter in double quotes, as in:

"[XMLFILE]"

it doesnt work.. took a few builds to figure this out, but it wasnt too bad. seems like a bug?
UdreaMihai
Posts: 90
Joined: Wed Mar 23, 2005 8:13 am

Hi,

There is no bug, you should put in the JVM Parameters field from the Java Product page the following text:

"-Dxmlfile=[TARGETDIR]Settings.xml" - correct usage in JVM Parameters filed

This text will be written in the INI file with two extra quotes, one before and one after. So the text that you should find written in the installed INI file is:

""-Dxmlfile=[TARGETDIR]Settings.xml"" - correct usage in the INI file

Those extra quotes appear because the original text ("-Dxmlfile=[TARGETDIR]Settings.xml") begins and ends with quotes so they must be doubled (that is a rule for INI values).

The [XMLFILE] property is not surrounded by quotes so there is nothing to duplicate. So in the INI it is written the property value:

""-Dxmlfile=[TARGETDIR]Settings.xml"" - correct usage in INI

The "[XMLFILE]" property is surrounded by quotes so it will be written in the INI as: ""[XMLFILE]"". Now expanding the property with its value("-Dxmlfile=[TARGETDIR]Settings.xml") from the custom action that you have used we have in the INI file the value:

"""-Dxmlfile=[TARGETDIR]Settings.xml""" - that is a wrong usage of the quotes in a INI file.

Hope it clears things up.

All the best,
Mihai
Udrea Mihai
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”