Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316512

Summary: JMX: Add JMX MBean support to Glassfish 3
Product: z_Archived Reporter: Michael OBrien <michael.f.obrien>
Component: EclipselinkAssignee: Michael OBrien <michael.f.obrien>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: douglas.clarke, eclipselink.foundation-inbox
Version: unspecifiedFlags: michael.f.obrien: documentation+
Target Milestone: ---   
Hardware: All   
OS: All   
URL: http://wiki.eclipse.org/EclipseLink/DesignDocs/316513
Whiteboard:
Bug Depends on: 296269, 318892    
Bug Blocks: 297312, 316513, 333336, 334381    
Attachments:
Description Flags
Glassfish V2 screencap of remote JConsole view of JMX EclipseLink MBeans (POC - for platform backwards compatibility)
none
Glassfish V3 3.0.1 of NetBeans 6.9 screencap of remote JConsole view of JMX EclipseLink MBeans (POC) none

Description Michael OBrien CLA 2010-06-10 14:23:48 EDT
>EclipseLink currently supports JMX MBeans on WebLogic 10.3 via bug# 248748
>This enhancement starts the investigation extend JMX support optionally to Glassfish
We are splitting the enhancement request by application server, the actual analysis, design and implementation will have aspects that are common to all 3 or 4 of these sub-requests.
Comment 1 Doug Clarke CLA 2010-06-29 11:40:41 EDT
After the ServerPlatform refactoring is complete we'll address MBean deployment in GlassFish
Comment 2 Michael OBrien CLA 2010-06-30 09:44:19 EDT
>JMXService url for GlassFish V3 is a really odd non-JMX spec 
service:jmx:rmi://xps435:8686/jndi/rmi://xps435:8686/jmxrmi
>instead of an expected
service:jmx:rmi://xps435:8686/jndi/jmxrmi
>Verified via remote call from JConsole

>The JMX standard non-JNDI registration will work with this server as it does for WebLogic, WebSphere and JBoss in enhancement bug# 316513
Comment 3 Michael OBrien CLA 2010-07-05 10:45:47 EDT
>Glassfish V2 (different than V3) via SUN JConsole working with remote and user:admin password:adminadmin
JMXServiceURL
service:jmx:rmi:///jndi/rmi://xps435:8686/jmxrmi

>Update EclipseLink bundles (5-6) via trunk ant target
ant dev-package-bundles

>2.1 MBean registration ok
[#|2010-07-05T10:34:29.841-0400|FINEST|sun-appserver2.1|org.eclipse.persistence.default|_ThreadID=14;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=d024ddab-f53b-4cab-b5e9-ad6820af471a;|Registered MBean: org.eclipse.persistence.services.glassfish.MBeanGlassfishRuntimeServices[TopLink:Name=Session(file_/C_/opt/glassfish/domains/domain1/applications/j2ee-apps/org.eclipse.persistence.example.jpa.server.glassfishv2.EnterpriseEAR/org.eclipse.persistence.example.jpa.server.glassfishv2.EnterpriseWeb_war/WEB-INF/classes/_enterprise)]|#]

>MBean Attributes and Operations are viewable and runable via JConsole like
[#|2010-07-05T10:41:36.767-0400|INFO|sun-appserver2.1|org.eclipse.persistence.session.file:/C:/opt/glassfish/domains/domain1/applications/j2ee-apps/org.eclipse.persistence.example.jpa.server.glassfishv2.EnterpriseEAR/org.eclipse.persistence.example.jpa.server.glassfishv2.EnterpriseWeb_war/WEB-INF/classes/_enterprise.server|_ThreadID=16;_ThreadName=RMI TCP Connection(18)-192.168.0.194;|Statement cache cleared.|#]
or
[#|2010-07-05T10:42:11.914-0400|FINEST|sun-appserver2.1|org.eclipse.persistence.session.file:/C:/opt/glassfish/domains/domain1/applications/j2ee-apps/org.eclipse.persistence.example.jpa.server.glassfishv2.EnterpriseEAR/org.eclipse.persistence.example.jpa.server.glassfishv2.EnterpriseWeb_war/WEB-INF/classes/_enterprise.cache|_ThreadID=16;_ThreadName=RMI TCP Connection(18)-192.168.0.194;ClassName=null;MethodName=null;_RequestID=d5bbe2fd-36ba-4797-99b7-b789ad7896ea;|Current object locks:
End of locked objects.
Comment 4 Michael OBrien CLA 2010-07-05 10:53:59 EDT
Created attachment 173434 [details]
Glassfish V2 screencap of remote JConsole view of JMX EclipseLink MBeans (POC - for platform backwards compatibility)
Comment 5 Michael OBrien CLA 2010-07-05 17:22:14 EDT
>Glassfish v3.0.1 install
https://glassfish.dev.java.net/downloads/3.0.1-final.html
or (in mixed english/spanish)
http://netbeans.org/downloads/start.html?platform=windows&lang=en&option=all

>netbeans 6.9
http://localhost:8080/GlassfishV3EAR-war/FrontController?action=demo
>original
INFO: EclipseLink, version: Eclipse Persistence Services - 2.0.1.v20100213-r6600
>on top of modules in the GF install dir, need to also replace the single jar in the NB install dir
C:\opt\nb69\java\modules\ext\eclipselink\eclipselink-2.0.2.jar

>Override EclipseLink 2.0.2 with the 2.1.1 trunk - replace or do not rename jar
C:\opt\nb69\java\modules\org-netbeans-modules-j2ee-eclipselink\org\netbeans\modules\j2ee\eclipselink\eclipselink_lib.xml
<resource>jar:nbinst:///modules/ext/eclipselink/eclipselink-2.0.2.jar!/</resource>

>after hacking netbeans 6.9 - turns out that osgi does not return to a working state when a deployment failed becuase of a CNFE - ended up using an application managed EAR deployment to override both the modules and the JPA 2.0 spec jar

>Use the default DS
<jta-data-source>jdbc/__default</jta-data-source>

>Glassfish 3.0.1 MBean registration ok
FINEST: Registered MBean: org.eclipse.persistence.services.glassfish.MBeanGlassfishRuntimeServices[TopLink:Name=Session(file_/C_/wnb69/GlassfishV3EAR/dist/gfdeploy/GlassfishV3EAR/GlassfishV3EAR-ejb_jar/_example)]

>Some MBean operations - PrintClassesInSession() and printIdentityMapLocks()
FINEST: org.eclipse.persistence.example.jpa.server.business.Cell
FINEST: Current object locks:
End of locked objects.
Comment 6 Michael OBrien CLA 2010-07-05 17:27:00 EDT
Created attachment 173484 [details]
Glassfish V3 3.0.1 of NetBeans 6.9 screencap of remote JConsole view of JMX EclipseLink MBeans (POC)

>via different JMXServiceURL that gets us access to JMX MBeans registered
service:jmx:rmi://xps435:8686/jndi/rmi://xps435:8686/jmxrmi
Comment 7 Michael OBrien CLA 2010-07-13 10:45:36 EDT
>See full generic patch for JBoss, WebSphere, WebLogic and Glassfish in parent bug# 316513
https://bugs.eclipse.org/bugs/attachment.cgi?id=173897&action=diff
Comment 9 Michael OBrien CLA 2010-11-05 16:16:55 EDT
>Java SUN JMX forum post
http://forums.oracle.com/forums/thread.jspa?messageID=9124630&#9124630
Comment 10 Michael OBrien CLA 2010-12-31 15:14:11 EST
>See JMX security issue with GlassFish V3
http://bugs.eclipse.org/333336
http://java.net/jira/browse/GLASSFISH-15337
Comment 11 Eclipse Webmaster CLA 2022-06-09 10:10:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink