admin@glassfish.java.net

RE: Closing a MBeanServerConnection

From: Rupert Young \(Restart\) <"Rupert>
Date: Thu, 23 Sep 2010 20:31:09 +0100

Thanks I tried both of those to no avail. I managed to workaround to some
extent by using a singleton, but there is still the issue of what happens if
the app server goes down. I am exiting with error, and allowing the OS to
restart my windows service.

 

Regards,

 

Rupert Young

Principal Architect

ReStart Consulting Ltd

Connecting the NHS

Ë UK: +44 1753 865879

Ë UK: +44 7795 480387

http://www.restartconsulting.com <BLOCKED::http://www.restartconsulting.com>


 

From: Tom Mueller [mailto:tom.mueller_at_oracle.com]
Sent: 21 September 2010 17:16
To: admin_at_glassfish.dev.java.net
Subject: Re: Closing a MBeanServerConnection

 

What version of GlassFish are you using?

In the v2 trunk source code for AppServerConnectionSource, I'm seeing a
getMBeanServerConnection method that takes a "forceNew" argument that
determines whether a new connection should be created or not. There is also
a getExistingMBeanServerConnection method that gets the existing connection.


Using this method might be a way to avoid the out of memory error.
Tom


On 9/21/2010 4:02 AM, Rupert Young (Restart) wrote:

With the management API creation of a MBeanServerConnection,

 

  aconn = new AppserverConnectionSource(host, port, user, pass, null);

  mconn = aconn.getMBeanServerConnection();

 

creates a new thread each time. If this in a loop it quickly results in an
outofmemory error.

 

How can the MBeanServerConnection be closed, there doesn’t appear to be an
appropriate method?

 

Regards,

 

Rupert Young

Principal Architect

ReStart Consulting Ltd

Connecting the NHS

Ë UK: +44 1753 865879

Ë UK: +44 7795 480387

http://www.restartconsulting.com <BLOCKED::http://www.restartconsulting.com>