-->

Eclipse Glassfish launch configuration - VM argume

2019-07-04 16:01发布

问题:

I am struggling to set up Glassfish 4 with Eclipse Kepler. No matter what I do, the VM arguments of the Glassfish launch configuration are not passed on to the VM running the server. Not even the argument (-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9009) that is put into the launch configuration by default by the Glassfish Tools for Eclipse plugin.

The running server has all system properties set according to the domain.xml of the started domain. The VM arguments specified in the start configuration are all lost on the way.

I have updated the Glassfhish plugin to the latest version. I have downloaded and unzipped Glassfish and then told Eclipse where to find the runtime. I have also let Eclipse download and install the server through the add-new-runtime wizard. It makes no difference.

The VM arguments text box contents are used though. If I enter two dashes I get an error, as expected, telling me that two dashes are not a valid VM option.

I was not able to find anything along the lines of this problem on the web. Which gives me the feeling that I am going about this the wrong way. But how?

The launch configuration:

VisualVM and ps -e | grep glassfish show none of the VM arguments.

回答1:

Maybe I'm wrong, but i think the eclipse plugin internally calls asadmin to start glassfish.

So VM arguments are not ignored, are used only on asadmin VM instance.

This may be plausible

  1. eclipse plugin calls asadmin start-domain domain1: batch file is launched.
  2. asadmin calls java -arguments-from-eclipse-plugin ..., let's name it java(asadmin). A first VM instance is created in which run asadmin classes, not glassfish.
  3. java(asadmin) calls java -arguments-from-domain-xml ... to start glassfish, let's name it java(glassfish).
  4. when the second VM instance is running, java(asadmin) exits.

So java(asadmin) does not transfer its arguments to java(glassfish).

I have no direct evidence of this behavior, but stated that:

  1. eclipse plugin arguments are lost
  2. domain.xml arguments are retained

this could be the reason.



回答2:

Are settings maybe ignored due to an (unsolicited) existence of parameters both in domain.xml and Eclipse?

Would this post help? Glassfish 4.0 won't start from Eclipse

Or this (seem also to affect 4.0): https://java.net/jira/browse/GLASSFISH-6582

https://community.jaspersoft.com/documentation/jasperreports-server-install-guide/v56/setting-jvm-options-application-servers#additional_646152231_1160916

Can't you just ditch the plugin/use another application server? Used JBoss AS and it was ok...