Skip to main content

Glassfish and MBeanServer

3 replies [Last post]
najmi
Offline
Joined: 2003-06-17

Hi Guys,

My webapp which deploys in Glassfish 3.1.2 starts its own MBeanServer at
port 1099 using spring JMX.
It appears that GF starts it own MBeanServer at port 8686. Is there some
way to tell GF to not start that server so my MbeanServer is the only
one for the JVM?

--
Regards,
Farrukh Najmi

Web: http://www.wellfleetsoftware.com

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tmueller
Offline
Joined: 2005-10-31

You can remove the element from the domain.xml (although
this is not a supported configuration).
Tom

On 1/10/13 10:18 AM, Farrukh Najmi wrote:
> Hi Guys,
>
> My webapp which deploys in Glassfish 3.1.2 starts its own MBeanServer
> at port 1099 using spring JMX.
> It appears that GF starts it own MBeanServer at port 8686. Is there
> some way to tell GF to not start that server so my MbeanServer is the
> only one for the JVM?
>

najmi
Offline
Joined: 2003-06-17

tmueller wrote:
You can remove the element from the domain.xml (although
this is not a supported configuration).

I did as you suggested and it fixed my problem. Here is what the diff of the file looks like:

~$ diff ~/glassfish-3.1.2/glassfish/domains/domain1/config/domain.xml~ ~/glassfish-3.1.2/glassfish/domains/domain1/config/domain.xml
85d84
<         <jmx-connector port="8686" address="0.0.0.0" security-enabled="false" auth-realm-name="admin-realm" name="system"></jmx-connector>
266d264
<         <jmx-connector port="${JMX_SYSTEM_CONNECTOR_PORT}" address="0.0.0.0" security-enabled="false" auth-realm-name="admin-realm" name="system"></jmx-connector>

My use case is that I need to authenticate the JMX Connection using my webaps spring-security based authentication layer. So I wrote some code that uses spring-jmx to create a JMC Connector that uses spring-security within my web-app. Thus I need to use that JMX connector and not some other.

Your suggested solution lets me do this :-) But it worries me that it is unsupported. Perhaps GF team might consider a supported solution for this use case in future?

BTW, I still see a message about there being multiple MBeanServers from spring-jmx:

[#|2013-01-11T09:25:39.028-0500|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=10;_ThreadName=Thread-2;|09:25:39,027  WARN JmxUtils:110 - Found more than one MBeanServer instance. Returning first from list.

I am not sure why that is or how to determine more information about them. But whereas before I could not connect to the JXM Connector my app was creating now I can.

mvatkina
Offline
Joined: 2005-04-04

In embedded EJB container we add enabled="false" to disable it...

-marina

On 1/10/13 9:08 AM, Tom Mueller wrote:
> You can remove the element from the domain.xml
> (although this is not a supported configuration).
> Tom
>
> On 1/10/13 10:18 AM, Farrukh Najmi wrote:
>> Hi Guys,
>>
>> My webapp which deploys in Glassfish 3.1.2 starts its own MBeanServer
>> at port 1099 using spring JMX.
>> It appears that GF starts it own MBeanServer at port 8686. Is there
>> some way to tell GF to not start that server so my MbeanServer is the
>> only one for the JVM?
>>
>