Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/DesignDocs/316513"

m (Enabling JMX MBeans)
m (Enabling JMX MBeans)
Line 36: Line 36:
 
===Enabling JMX MBeans===
 
===Enabling JMX MBeans===
 
*The following properties will continue to enable registration for '''any''' capable ''application server''.
 
*The following properties will continue to enable registration for '''any''' capable ''application server''.
 +
*No code changes required at this point.
 +
 
**http://wiki.eclipse.org/EclipseLink/DesignDocs/248748#Disabling_EclipseLink_Managed_Lazy_Registration
 
**http://wiki.eclipse.org/EclipseLink/DesignDocs/248748#Disabling_EclipseLink_Managed_Lazy_Registration
 +
====WebLogic====
 
<pre>
 
<pre>
 
rem set JAVA_OPTIONS=%JAVA_OPTIONS% -Declipselink.register.dev.mbean=true
 
rem set JAVA_OPTIONS=%JAVA_OPTIONS% -Declipselink.register.dev.mbean=true
 
rem set JAVA_OPTIONS=%JAVA_OPTIONS% -Declipselink.register.run.mbean=true
 
rem set JAVA_OPTIONS=%JAVA_OPTIONS% -Declipselink.register.run.mbean=true
 
</pre>
 
</pre>
*No code changes required at this point.
+
====JBoss====
 +
*'''<font color="green">jboss-eap-5.0/jboss/as/bin/run.bat:83</font>'''
 +
<pre>
 +
// after
 +
set JAVA_OPTS=%JAVA_OPTS% "-Djava.library.path=%JBOSS_NATIVE_HOME%;%PATH%;%SYSTEMROOT%"
 +
// add
 +
set JAVA_OPTS=%JAVA_OPTS% -Declipselink.register.run.mbean=true
 +
 
 +
</pre>
 +
====WebSphere====
  
 
===WebLogic JMX Integration===
 
===WebLogic JMX Integration===

Revision as of 14:30, 22 June 2010

Design Specification: Extend WebLogic 10.3 JMX MBean support to JBoss 5.1.0 and WebSphere 7 as generic API

Work in Queue

Completed Work

JPA EAR, EJB, WAR and SE (DDL Generation) WebLogic 10.3 J2EE application Eclipse projects in SVN - use to perform JMX MBean registration

Document History

Date Author Version Description & Notes
2010-06-10 Michael O'Brien 0.1 Starting Draft for Generic JMX MBean support to extend WebLogic 10.3 support to JBoss 5.1.0 EAP and WebSphere 7 for ER 316513
2010-06-22 Michael O'Brien 0.2 Develop/Document JBoss 5.1.0 EAP JMX registration code ER 316511

Project overview

Analysis

Enabling JMX MBeans

  • The following properties will continue to enable registration for any capable application server.
  • No code changes required at this point.

WebLogic

rem set JAVA_OPTIONS=%JAVA_OPTIONS% -Declipselink.register.dev.mbean=true
rem set JAVA_OPTIONS=%JAVA_OPTIONS% -Declipselink.register.run.mbean=true

JBoss

  • jboss-eap-5.0/jboss/as/bin/run.bat:83
// after
set JAVA_OPTS=%JAVA_OPTS% "-Djava.library.path=%JBOSS_NATIVE_HOME%;%PATH%;%SYSTEMROOT%"
// add
set JAVA_OPTS=%JAVA_OPTS% -Declipselink.register.run.mbean=true

WebSphere

WebLogic JMX Integration

JBoss JMX Integration

  • 20100622: This section details the JMX registration code for EclipseLink MBeans on JBoss 5.1.0 EAP
  • See jar signing and JMX prepending issues solved in bug# 305331 specific to the JBoss EAP edition that need to be covered off.

Modules

NEW: core:services.mbean.jboss.MBeanJBossRuntimeServices.java
NEW: core:services.mbean.jboss.MBeanJBossRuntimeServicesMBean.java
NEW: core:services.mbean.jboss.JBossRuntimeServices.java
MOD: core:services.mbean.weblogic.ClassSummaryDetail.java moved up to parent package
MOD: core:platform.server.jboss.JBossPlatform.java

WebSphere JMX Integration

GlassFish JMX Integration

Design

Design Issue NN:

Analysis NN:

Solution NN:

Implementation

Testing

JBoss Specific EAR Configuration

  • The following scenario specifies @Remote on the remote interface and @Stateless on the stateless session bean.
    • This results in the following JNDI name emitted by the server on EAR deploy
@Stateless(name="ApplicationService", mappedName="ApplicationService")
@Remote(ApplicationServiceRemote.class)
public class ApplicationService implements ApplicationServiceRemote  {
	@PersistenceContext(unitName="example", type=PersistenceContextType.TRANSACTION)	
	private EntityManager entityManager;
...
}
 
public class FrontController extends HttpServlet implements Servlet {
    public static final String APPLICATION_SERVICE_JNDI_NAME 
      = "org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR/ApplicationService/remote-org.eclipse.persistence.example.jpa.server.business.ApplicationServiceRemote";    
 
    /**
     * Get the SSB ApplicationService bean - using a JNDI context lookup (no EJB injection was used on this servlet)
     * @param viaJNDILookup
     * @return
     */
    public ApplicationServiceRemote getApplicationService(boolean viaJNDILookup) {
        if(null == applicationService && viaJNDILookup) {
            try {
                Hashtable<String, String> env = new Hashtable<String, String>();      
                env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");     
                env.put(Context.PROVIDER_URL, "localhost");      
                env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );     
                InitialContext ctx = new InitialContext(env);
                System.out.println("FrontController.getApplicationService() JNDI lookup of " + APPLICATION_SERVICE_JNDI_NAME);
                return (ApplicationServiceRemote) ctx.lookup(APPLICATION_SERVICE_JNDI_NAME);            
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException("couldn't lookup Dao", e);
            }
        } else {
            return applicationService;
        }
    }
...
}

Testing Data Model

Open Issues

References

Back to the top