|
|
(5 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | =EclipseLink JMX MBean support in WebLogic=
| + | see [http://wiki.eclipse.org/Integrating_EclipseLink_with_an_Application_Server_(ELUG)#How_to_Integrate_JMX WebLogic JMX EclipseLink User Guide] |
− | The API discussed here has been checked in as part of enhancements [[http://wiki.eclipse.org/EclipseLink/DesignDocs/235168 235168]]
| + | |
− | [[http://wiki.eclipse.org/EclipseLink/DesignDocs/248748 248748]]
| + | |
− | | + | |
− | EclipseLink supports JMX MBean access to runtime and development attributes/functions against JPA container managed applications running on WebLogic server.
| + | |
− | | + | |
− | ==Public API - For Designers==
| + | |
− | | + | |
− | The following JMX MBean public API is exposed by the EclipseLink runtime services MBean and is available to any JMX compliant client.
| + | |
− | | + | |
− | From your MBeanServer on WebLogic 10.3.3.1 get an implementation of [http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/services/weblogic/MBeanWebLogicRuntimeServices.java org.eclipse.persistence.services.weblogic.MBeanWebLogicRuntimeServices] which extends [http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/services/weblogic/WebLogicRuntimeServices.java WebLogicRuntimeServices] and implements the interface [http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/services/weblogic/MBeanWebLogicRuntimeServicesMBean.java MBeanWebLogicRuntimeServicesMBean] in the same package.
| + | |
− | | + | |
− | ==Tutorial Source==
| + | |
− | See the 4 SVN projects that will populate your database and run a JEE JPA application on WebLogic 10.3 so that an EclipseLink JPA session is exposed for JMX MBean access.
| + | |
− | | + | |
− | http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial#Tutorial_Source
| + | |
− | | + | |
− | or
| + | |
− | | + | |
− | [http://bugs.eclipse.org/243585 JPA EAR WebLogic 10.3 J2EE application and J2SE table populator Eclipse project zip files]
| + | |
− | | + | |
− | ==Prerequisites==
| + | |
− | ===Setting Breakpoints===
| + | |
− | The eclipselink.jar deployed in $WEBLOGIC_HOME/modules/org.eclipse.persistence_1.0.0.0_1-0.jar will need a source attachment. The fastest way is to set a breakpoint on org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.undeploy(), point to the src jar or your workspace projects and redeploy. Any breakpoints in the predeploy or prior to the first login will now be hit.
| + | |
− | | + | |
− | ===Enabling remote access on the WebLogic JVM===
| + | |
− | Add the following JVM option to your WebLogic startup script
| + | |
− | ====WebLogic 10.3.0====
| + | |
− | <pre>
| + | |
− | C:\opt\wls103\user_projects\domains\base_domain\bin\startWebLogic.cmd
| + | |
− | set JAVA_OPTIONS=%JAVA_OPTIONS% -Dcom.sun.management.jmxremote
| + | |
− | </pre>
| + | |
− | | + | |
− | | + | |
− | | + | |
− | ===System properties to enable EclipseLink MBeans===
| + | |
− | MBean registration is enabled by adding one or both of the two mbean system properties
| + | |
− | If [eclipselink.register.dev.mbean] or [eclipselink.register.run.mbean] properties are missing then MBean registration will not proceed for that bean.
| + | |
− | <pre>
| + | |
− | rem set JAVA_OPTIONS=%JAVA_OPTIONS% -Declipselink.register.dev.mbean=true
| + | |
− | set JAVA_OPTIONS=%JAVA_OPTIONS% -Declipselink.register.run.mbean=true
| + | |
− | </pre>
| + | |
− | | + | |
− | ===Configuring WebLogic Server Domain Security===
| + | |
− | *If you are running your MBeans unsecured or in a development environment - you will need to disable security to see them outside of WebLogic
| + | |
− | *Select the [[http://localhost:7001/consolehelp/console-help.portal?_nfpb=true&_pageLabel=page&helpId=Securitysecuritydomaindomainconfiggeneraltitle#security.domain.domainconfiggeneral.securityconfiguration.anonymousadminlookupenabled.label Anonymous Admin Lookup Enabled checkbox]] on the admin console security tab and restart. (Or you will get the following security warning).
| + | |
− | <pre>
| + | |
− | [EL Warning]: 2008.06.19 13:37:01.875--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Failed to find MBean Server: javax.naming.NoPermissionException:
| + | |
− | User <anonymous> does not have permission on weblogic.management.home to perform lookup operation.
| + | |
− | </pre>
| + | |
− | [[Image:Weblogic103_console_jmx_anon_security.jpg]]
| + | |
− | ==JMX MBeans via SE Client==
| + | |
− | See the [http://java.sun.com/docs/books/tutorial/jmx/remote/custom.html SUN JMX Tutorial].
| + | |
− | | + | |
− | For Java6 only - A proxy can be used to invoke methods on the MBean via JMX.newMBeanProxy().
| + | |
− | | + | |
− | ==JMX MBeans via Enterprise Manager 11==
| + | |
− | *Your WebLogic server will need to be added to an Enterprise Manager Server as a new domain.
| + | |
− | *To add your WebLogic server to an Oracle Enterprise Manager Console please do the following.
| + | |
− | **- add your server to one of your hosted EM application servers on the following EM URLs
| + | |
− | ***http://stado20.us.oracle.com:7001/em
| + | |
− | ***http://stacx52.us.oracle.com:7001/em
| + | |
− | ***http://sta00788.us.oracle.com:7001/em
| + | |
− | **- click "farm_em_doamin" target in list of "All Targets"
| + | |
− | **- enter "weblogic/weblogic" as the default username/password,
| + | |
− | **- click "Setup" to add your domain.
| + | |
− | **- navigate to WebLogic Domain | base_domain | <server = AdminServer>
| + | |
− | **- expand on "Application Defined MBeans" | org.eclipse.persistence or TopLink
| + | |
− | **- expand Configuration | Development bean
| + | |
− | ** or
| + | |
− | **- expand Reporting | Runtime bean
| + | |
− | | + | |
− | [[Image:Eclipselink_mbeans_on_enterprise_manager2.gif]]
| + | |
− | | + | |
− | ==JMX MBeans via JConsole==
| + | |
− | The standard SUN JDK <JAVA_HOME>/bin/jconsole.exe application can be used to view the MBeans exposed by the WebLogic server JVM instance.
| + | |
− | | + | |
− | Start jconsole at the run|cmd prompt and select the running weblogic.Server local process.
| + | |
− | | + | |
− | [[Image:Jconsole_attach_to_weblogic_server_jvm.jpg]]
| + | |
− | | + | |
− | You should see the following EclipseLink MBeans off the root of the JNDI tree. In this example there are 2 separate EARs deployed to WebLogic - each with its own set of MBeans based on the login session.
| + | |
− | | + | |
− | [[Image:Eclipselink_jmx_mbeans_in_jconsole.jpg]]
| + | |
− | | + | |
− | ==References==
| + | |
− | EclipseLink User Guide documentation on setting up JMX access | + | |
− | | + | |
− | http://wiki.eclipse.org/Integrating_EclipseLink_with_an_Application_Server_(ELUG)#How_to_Integrate_JMX
| + | |
− | | + | |
− | EclipseLink JMX configuration in Workbench
| + | |
− | | + | |
− | http://wiki.eclipse.org/Configuring_a_Session_%28ELUG%29#Configuring_the_Server_Platform
| + | |