dev@glassfish.java.net

Re: passing Java options to v3 thru startserv

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Thu, 17 Apr 2008 11:48:45 -0700

Byron Nevins wrote:
> What you did was add system props/java options to asadmin's JVM.
> asadmin launches a new JVM with V3. asadmin does not pass its own sys
> props/jvm options to the launched server (rightly so!)
>
ok.

> If you start V3 with 'java -jar glassfish...' it will work because
> that "java" *is* the JVM running V3! Of course, you won't get any
> jvm-options that are set in domain.xml
>
Most of the time during development this is pretty much what users will
be doing. This makes me think shouldn't startserv should invoke
glassfish-10.jar instead of asadmin-cli. Anyone in production can always
use asadmin command.
>
> There are a number of ways to solve your problem, in order of
> desirability
> 1) this works now and it is the best way -- add jvm options to
> domain.xml V3 will be launched with those props/jvm options
> 2) add a new param to 'start-domain', say --jvmoptions
> 3) Define an official env. variable, say, GF_JVM_OPTS which would
> automatically be used by launcher

2 and 3 would be worth looking at.

-vivek.
>
> Vivek Pandey wrote:
>
>> I was looking at easy way to pass system properties or java options
>> while using v3 startup script 'startserv'.
>>
>> Can we not have JAVA_OPTS env variable to pass such values:
>>
>> 11c11
>> < exec java $JAVA_OPTS -jar
>> "$AS_INSTALL_LIB/admin-cli-10.0-SNAPSHOT.jar" start-domain --verbose
>> "$@"
>> ---
>> > exec java -jar "$AS_INSTALL_LIB/admin-cli-10.0-SNAPSHOT.jar"
>> start-domain --verbose "$@"
>>
>>
>> I tried and it does not seem to work. Although if I start using
>> glassfish-10.0-SNAPSHOT.jar instaed of admin-cli-10.0-SNAPSHOT.jar
>> then the system properties passed to java works! I could have made it
>> work using java -jar from command line but it is hard to automate or
>> document as the jar file name will keep changing across different v3
>> milestones and providing options to the startup script to pass such
>> otions to java is available in most of the web servers such as tomcat
>> (catalina.sh).
>>
>> -vivek.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>