GlassFish JVM properties (-javaagent)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

GlassFish JVM properties (-javaagent)

Arshan Dabirsiaghi
First off, let me say that I don't know how I'd do my job without Cargo!

So, onto the issue. I can't seem to set the JVM options for GlassFish 3.1.2. This seems to be closely related to CARGO-1108 [1], which just addressed system properties. Maybe something similar needs to be done for JVM options?

The fix for 1108 is here [2].

The problem, I think, is that it sets the JVM options on the calls to asadmin to perform the tasks or loading the WARs -- it doesn't actually change the JVM options for the app server process, which should be done via 'create-jvm-options' [3].

I use the same code to set the JVM options across all of my Tomcat, JBoss, Jetty and WebLogic Cargo-driven tests, so I'm pretty confident the setting of the JVM options is done correctly.

I'll create an issue in JIRA if you agree.

Thanks,
Arshan

Reply | Threaded
Open this post in threaded view
|

Re: GlassFish JVM properties (-javaagent)

Arshan Dabirsiaghi
I think the problem is in AbstractGlassFishStandaloneLocalConfiguration.java, starting on line 164 [snippet below]. It seems to only actually support the -Xmx and -XX:MaxPermSize options. I need support for -javaagent for my purposes. Note that -javaagent switches are of the format:

-javaagent:path/to/jar

As opposed to the more typical convention in JVM options:

-option=value

Here's the problematic section (I think):

String jvmArgs = this.getPropertyValue(GeneralPropertySet.JVMARGS);

        if (jvmArgs != null)

        {

            String xmx = this.getJvmArg(jvmArgs, "-Xmx");

            if (xmx != null)

            {

                domainXmlReplacements.put("-Xmx512m", xmx);

            }


            String maxPermSize = this.getJvmArg(jvmArgs, "-XX:MaxPermSize");

            if (maxPermSize != null)

            {

                domainXmlReplacements.put("-XX:MaxPermSize=192m", maxPermSize);

            }

        }

Thanks,
Arshan



On Fri, Sep 27, 2013 at 3:07 PM, Arshan Dabirsiaghi <[hidden email]> wrote:
First off, let me say that I don't know how I'd do my job without Cargo!

So, onto the issue. I can't seem to set the JVM options for GlassFish 3.1.2. This seems to be closely related to CARGO-1108 [1], which just addressed system properties. Maybe something similar needs to be done for JVM options?

The fix for 1108 is here [2].

The problem, I think, is that it sets the JVM options on the calls to asadmin to perform the tasks or loading the WARs -- it doesn't actually change the JVM options for the app server process, which should be done via 'create-jvm-options' [3].

I use the same code to set the JVM options across all of my Tomcat, JBoss, Jetty and WebLogic Cargo-driven tests, so I'm pretty confident the setting of the JVM options is done correctly.

I'll create an issue in JIRA if you agree.

Thanks,
Arshan


Reply | Threaded
Open this post in threaded view
|

Re: GlassFish JVM properties (-javaagent)

S. Ali Tokmen
Hi Arshan

Well spotted! I've opened https://jira.codehaus.org/browse/CARGO-1224 for this one and actually think fixed it with revision 3736.

Feel free to try version 1.4.5-SNAPSHOT to see if it helps. Instructions are on http://cargo.codehaus.org/Maven2+Plugin+Installation#Maven2PluginInstallation-snapshots but since the code has just been checked in it would take 1-2 hours to reach the SNAPSHOT repository.

As an alternative, you can always build the code yourself.

Cheers

S. Ali Tokmen
http://ali.tokmen.com/

My IM, GSM, PGP and other contact details
are on http://contact.ali.tokmen.com
On 9/27/13 21:32 , Arshan Dabirsiaghi wrote:
I think the problem is in AbstractGlassFishStandaloneLocalConfiguration.java, starting on line 164 [snippet below]. It seems to only actually support the -Xmx and -XX:MaxPermSize options. I need support for -javaagent for my purposes. Note that -javaagent switches are of the format:

-javaagent:path/to/jar

As opposed to the more typical convention in JVM options:

-option=value

Here's the problematic section (I think):

String jvmArgs = this.getPropertyValue(GeneralPropertySet.JVMARGS);

        if (jvmArgs != null)

        {

            String xmx = this.getJvmArg(jvmArgs, "-Xmx");

            if (xmx != null)

            {

                domainXmlReplacements.put("-Xmx512m", xmx);

            }


            String maxPermSize = this.getJvmArg(jvmArgs, "-XX:MaxPermSize");

            if (maxPermSize != null)

            {

                domainXmlReplacements.put("-XX:MaxPermSize=192m", maxPermSize);

            }

        }

Thanks,
Arshan



On Fri, Sep 27, 2013 at 3:07 PM, Arshan Dabirsiaghi <[hidden email]> wrote:
First off, let me say that I don't know how I'd do my job without Cargo!

So, onto the issue. I can't seem to set the JVM options for GlassFish 3.1.2. This seems to be closely related to CARGO-1108 [1], which just addressed system properties. Maybe something similar needs to be done for JVM options?

The fix for 1108 is here [2].

The problem, I think, is that it sets the JVM options on the calls to asadmin to perform the tasks or loading the WARs -- it doesn't actually change the JVM options for the app server process, which should be done via 'create-jvm-options' [3].

I use the same code to set the JVM options across all of my Tomcat, JBoss, Jetty and WebLogic Cargo-driven tests, so I'm pretty confident the setting of the JVM options is done correctly.

I'll create an issue in JIRA if you agree.

Thanks,
Arshan



Reply | Threaded
Open this post in threaded view
|

Re: GlassFish JVM properties (-javaagent)

Arshan Dabirsiaghi
Your fix works well. Thanks for the quick turnaround, and keep up the great work.

Thanks,
Arshan


On Fri, Sep 27, 2013 at 6:20 PM, S. Ali Tokmen <[hidden email]> wrote:
Hi Arshan

Well spotted! I've opened https://jira.codehaus.org/browse/CARGO-1224 for this one and actually think fixed it with revision 3736.

Feel free to try version 1.4.5-SNAPSHOT to see if it helps. Instructions are on http://cargo.codehaus.org/Maven2+Plugin+Installation#Maven2PluginInstallation-snapshots but since the code has just been checked in it would take 1-2 hours to reach the SNAPSHOT repository.

As an alternative, you can always build the code yourself.

Cheers

S. Ali Tokmen
http://ali.tokmen.com/

My IM, GSM, PGP and other contact details
are on http://contact.ali.tokmen.com
On 9/27/13 21:32 , Arshan Dabirsiaghi wrote:
I think the problem is in AbstractGlassFishStandaloneLocalConfiguration.java, starting on line 164 [snippet below]. It seems to only actually support the -Xmx and -XX:MaxPermSize options. I need support for -javaagent for my purposes. Note that -javaagent switches are of the format:

-javaagent:path/to/jar

As opposed to the more typical convention in JVM options:

-option=value

Here's the problematic section (I think):

String jvmArgs = this.getPropertyValue(GeneralPropertySet.JVMARGS);

        if (jvmArgs != null)

        {

            String xmx = this.getJvmArg(jvmArgs, "-Xmx");

            if (xmx != null)

            {

                domainXmlReplacements.put("-Xmx512m", xmx);

            }


            String maxPermSize = this.getJvmArg(jvmArgs, "-XX:MaxPermSize");

            if (maxPermSize != null)

            {

                domainXmlReplacements.put("-XX:MaxPermSize=192m", maxPermSize);

            }

        }

Thanks,
Arshan



On Fri, Sep 27, 2013 at 3:07 PM, Arshan Dabirsiaghi <[hidden email]> wrote:
First off, let me say that I don't know how I'd do my job without Cargo!

So, onto the issue. I can't seem to set the JVM options for GlassFish 3.1.2. This seems to be closely related to CARGO-1108 [1], which just addressed system properties. Maybe something similar needs to be done for JVM options?

The fix for 1108 is here [2].

The problem, I think, is that it sets the JVM options on the calls to asadmin to perform the tasks or loading the WARs -- it doesn't actually change the JVM options for the app server process, which should be done via 'create-jvm-options' [3].

I use the same code to set the JVM options across all of my Tomcat, JBoss, Jetty and WebLogic Cargo-driven tests, so I'm pretty confident the setting of the JVM options is done correctly.

I'll create an issue in JIRA if you agree.

Thanks,
Arshan