dev@glassfish.java.net

Re: passing Java options to v3 thru startserv

From: Byron Nevins <Byron.Nevins_at_Sun.COM>
Date: Sun, 17 Aug 2008 11:28:50 -0700

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!)

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


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

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
>

-- 
Byron Nevins Work 408-276-4089, Home 650-359-1290, Cell 650-784-4123 - Sun Microsystems, Inc.