dev@glassfish.java.net

[Ask]About Java System Property Setting

From: Tang Yong <tangyong_at_cn.fujitsu.com>
Date: Tue, 29 Jan 2013 11:46:00 +0900

Hi Sahoo
CC Team

I have a question about Java System Property Setting:

[Background]
I access internet behind a http proxy. I know that after starting
glassfish domain, I can set jvm options(http proxy) by the following,

asadmin create-jvm-options -Dhttp.proxyHost=XXXXX
asadmin create-jvm-options -Dhttp.proxyPort=XXXXX

Then, restarting domain will OK. However, imaging such a scene:

If I want to access internet's resource while starting glassfish domain
rather than after starting glassfish domain. For example, I have a
bundle which is put into autostart directory and I want to access
http://repo1.maven.org/maven2/... to generate OSGi OBR resources to meet
some provisioning stories by the bundle. Then, current glassfish does
not meet such a requirement because gf can not offer a way to set
http.proxyHost and http.proxyPort while starting gf domain.

I have tried to add these system properties into config/osgi.properties,
however, this have not any effect.

Noting that in [1] , the following is said:

"These system properties can be set directly on the command line when
starting the JVM using the standard "-D<prop>=<value>" syntax or you can
put them in the lib/system.properties file of your Felix installation;
see the next section on configuring Felix for more information."

So, while launching felix, whether gf can offer some way to load system
properties or not?

[1]:
http://felix.apache.org/site/apache-felix-framework-usage-documentation.html

Thanks
--Tang