简体   繁体   English

如何在Glassfish 3的管理控制台中设置系统属性?

[英]How do I set a system property from the admin console in Glassfish 3?

I found this this article on how to do it on the command line, but I'd like to set it from the admin console (the GUI) or modifying the domain.xml. 我在命令行上找到了这篇文章,但我想从管理控制台(GUI)或修改domain.xml进行设置。 In glassfish v2, this was as simple as modifying the domain.xml and adding a <jvm-options> . 在glassfish v2中,这就像修改domain.xml并添加<jvm-options>一样简单。 But, I did the same thing in glassfish v3, and my war doesn't seem to have access to this property. 但是,我在glassfish v3中做了同样的事情,我的战争似乎无法使用此属性。

It should be as easy as you described it. 它应该像您描述的那样简单。 If you want to go "domain.xml-way" you have to make sure the additional <jvm-options> is inside of the existing <java-config> like this: 如果要使用“ domain.xml-way”,则必须确保其他<jvm-options>在现有的<java-config>内部,如下所示:

  <java-config>
    <jvm-options>-XX:NewRatio=2</jvm-options>
  </java-config>

You must restart the server to make it work. 您必须重新启动服务器才能使其正常工作。

Alternativly you can set it up in the Glassfish admin GUI ( http://localhost:4848 ). 另外,您可以在Glassfish管理GUI( http://localhost:4848 )中进行设置。
Navigate to Configurations -> server-config -> JVM Settings -> JVM Options and add your new option. 导航到“ Configurations ->“ server-config ->“ JVM Settings ->“ JVM Options然后添加新选项。

glassfish管理员gui

This can be changed by going to 可以通过以下方法更改

server -> properties

Then adding a system property by pressing the "Add Property" button. 然后通过按“添加属性”按钮添加系统属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM