Community
Participate
Working Groups
>Problem: In some managed WebLogic use cases (SOA) the a JMX spec factory call returns MBeanServer instances in a different order. It turns out that the strategy of using the first one with a non-null domain does not work in the SOA case for WebLogic - as it does for JBoss. MBeanServer mBeanServerRuntime = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0); The fix could be on the SOA side to check both MBeanServer instances, or in EclipseLink using a change to our WLS platform class (extra registration checking, or revert to WLS specific ExecuteThread lookup). Either way, the new generic registration code is out - only for WebLogic, but stays for WebSphere, JBoss and Glassfish. We need to either check that the correct [0] or [1] indexed MBeanServer is being used (by looking for WebLogic MBeans), or - simpler, just use the old proprietary ExecuteThread (non-JMX spec) MBeanServerFactory code. This is a rework of design issues 3 and 4 of bug # 316513 In 316513 design issue #3 and #4 a decision was made to use the first one on the list that has a non-null domain. However, the indexing code can be changed to check the classLoader in this instance. Or we may need to use one of the other 2 methods to get the correct server directly instead of receiving a List of them from the JMX spec function. This looks to be related to the fact that 2 MBeanServers are available from the MBeanServer factory when running either WebLogic on JRockit. JBoss (with any JVM) http://wiki.eclipse.org/EclipseLink/DesignDocs/316513#DI_4:_20100624:_Verify_correct_MBeanServer_available_when_running_multiple_MBeanServer_Instances http://wiki.eclipse.org/EclipseLink/DesignDocs/316513#Option_2:_Direct_factory_reference_via_JMX_API "Get the first server in the list - usually the only one unless we are running on Oracle JRockit"
10206522
>A full fix will either revert the weblogic part of 7844 or refactor to use the "com.bea" containing server In the interest of expediency - a quick fix will be to revert to pre 7844 code - just for WebLogic. - this will gaurantee that we only get the single "com.bea" based server for registration. We can revisit whether we want to add logic to determine which instance to use when multiple MBeanServers are returned in "some" managed server cases. >Attachment #174515 [details]: Handle multiple MBeanServer instances from MBeanServerFactory for bug #316513 >revert line 51 of https://bugs.eclipse.org/bugs/attachment.cgi?id=173104&action=diff#foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/platform/server/JMXServerPlatformBase.java_sec1 mBeanServer = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0); line 109 (rev 7777) of https://bugs.eclipse.org/bugs/attachment.cgi?id=173897&action=diff#foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/platform/server/JMXServerPlatformBase.java_sec1 if(mBeanServerList.size() > 1) { http://fisheye2.atlassian.com/changelog/eclipselink/?cs=7777 and https://bugs.eclipse.org/bugs/attachment.cgi?id=174515&action=diff http://fisheye2.atlassian.com/changelog/eclipselink/?cs=7844
>Some more SRDemo triage (looks like SRDemo is causing us to only see a SUN MBeanServer - check the instance name in the logs) The log I got from Yiping shows that the MBeanServer is the wrong SUN one - and that there is only one (11:23:14) yiping: ####<Oct 13, 2010 12:48:44 PM PDT> <Notice> <EclipseLink> <stame15> <soa_server1> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <sking> <BEA1-05197CD319C360994897> <c64b22a632b93280:1f76906d:12ba40e2b56:-7ffe-0000000000001ad9> <1286999324857> <BEA-2005000> <2010-10-13 12:48:44.857-- JMX MBeanServer instance found: [com.sun.jmx.mbeanserver.JmxMBeanServer@edd9fd1], # of beans: [31], domain: [DefaultDomain] at index: [0].> This "com.sun.jmx.mbeanserver.JmxMBeanServer" one only has 31 beans but it should be "weblogic.management.jmx.mbeanserver.WLSMBeanServer" with 485 beans However, there should be a second weblogic one - that is the right one to use, on my standalone server I see <16-Oct-2010 8:25:32 o'clock AM VET> <Notice> <EclipseLink> <BEA-2005000> <2010-10-16 08:25:32.923-- JMX MBeanServer instance found: [weblogic.management.jmx.mbeanserver.WLSMBeanServer@3aaab89], # of beans: [485], domain: [base_domain] at index: [0].> "weblogic.management.jmx.mbeanserver.WLSMBeanServer" with 485 beans >An instanceof check should be done >Anyway, further triage can be done later, for now I am going to use the older ExecuteThread method of server lookup - which only returns one instance.
Created attachment 181129 [details] 328006 WebLogic specific mbean registration via JNDI instead of JMX spec to handle case of multiple MBeanServers from factory call
>Regression testing 1 (WebLogic) of 4 (JBoss, WebSphere, GlassFish) Config=standalone, JRockit, development(non-prod), Win7-64 Oracle WebLogic Server 11gR1 PatchSet 3 rc6 at localhost [Oracle WebLogic Server] Java HotSpot(TM) Client VM[localhost:8453] Daemon Thread [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)'] (Suspended) WebLogic_10_Platform.getMBeanServer() line: 186 WebLogic_10_Platform(JMXServerPlatformBase).serverSpecificRegisterMBean() line: 235 WebLogic_10_Platform.serverSpecificRegisterMBean() line: 156 WebLogic_10_Platform(ServerPlatformBase).registerMBean() line: 510 ServerSession(DatabaseSessionImpl).postConnectDatasource() line: 682 ServerSession(DatabaseSessionImpl).login() line: 628 EntityManagerFactoryProvider.login(ServerSession, Map) line: 230 EntityManagerSetupImpl.deploy(ClassLoader, Map) line: 392 EntityManagerFactoryImpl.getServerSession() line: 164 EntityManagerFactoryImpl.createEntityManagerImpl(Map) line: 221 EntityManagerFactoryImpl.createEntityManager() line: 209 TransactionalEntityManagerProxyImpl.newPersistenceContext(PersistenceUnitInfoImpl) line: 65 TransactionalEntityManagerProxyImpl(BasePersistenceContextProxyImpl).getPersistenceContext(Transaction) line: 170 TransactionalEntityManagerProxyImpl(BasePersistenceContextProxyImpl).invoke(Object, Method, Object[], Transaction) line: 101 TransactionalEntityManagerProxyImpl.invoke(Object, Method, Object[], Transaction) line: 91 TransactionalEntityManagerProxyImpl(BasePersistenceContextProxyImpl).invoke(Object, Method, Object[]) line: 87 TransactionalEntityManagerProxyImpl.invoke(Object, Method, Object[]) line: 18 $Proxy67.toString() line: not available String.valueOf(Object) line: 2826 StringBuilder.append(Object) line: 115 ApplicationService_5ptwty_Impl(ApplicationService).insertObjects(List<Cell>) line: 60 MBeanServer instance is weblogic.management.jmx.mbeanserver.WLSMBeanServer@988584 [EL Info]: 2010-10-18 16:03:03.288--ServerSession(12105567)--Thread(Thread[[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads]) --file:/F:/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example login successful [EL Finer]: 2010-10-18 16:05:07.038--ServerSession(12105567)--Thread(Thread[[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads]) --JMX MBeanServer instance found: [weblogic.management.jmx.mbeanserver.WLSMBeanServer@988584], # of beans: [505], domain: [base_domain] at index: [0]. [EL Finest]: 2010-10-18 16:05:29.949--ServerSession(12105567)--Thread(Thread[[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads]) --Registered MBean: org.eclipse.persistence.services.mbean.MBeanDevelopmentServices[TopLink:Name=Development-file_/F_/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example,Type=Configuration] [EL Finest]: 2010-10-18 16:05:35.4--ServerSession(12105567)--Thread(Thread[[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads]) --Registered MBean: org.eclipse.persistence.services.weblogic.MBeanWebLogicRuntimeServices[TopLink:Name=Session(file_/F_/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example)] [EL Finest]: 2010-10-18 16:08:53.472--ServerSession(12105567)--Thread(Thread[[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads]) --The applicationName for the MBean attached to session [file:/F:/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example] is [org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEAR] [EL Finest]: 2010-10-18 16:08:54.053--ServerSession(12105567)--Thread(Thread[[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads]) --The moduleName for the MBean attached to session [file:/F:/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example] is [enterprise]
Created attachment 181131 [details] 2.1.2 mirror patch of above change for WebLogic MBean registration
>2.1.2 testing persistence.xml <property name="eclipselink.target-server" value="WebLogic_10"/> <property name="eclipselink.target-database" value="Derby"/> <property name="eclipselink.logging.level" value="FINEST"/> <!-- new for 10.3.4.0 http://wiki.eclipse.org/EclipseLink/Examples/JPA/Logging#Server_Logging --> <property name="eclipselink.logging.logger" value="DefaultLogger"/> <18-Oct-2010 4:28:11 o'clock PM EDT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.4.0 Fri Oct 1 20:26:51 PDT 2010 1368456 > [EL Info]: 2010-10-18 16:28:20.9--ServerSession(33006544)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--EclipseLink, version: Eclipse Persistence Services - 2.1.2.qualifier [EL Finer]: 2010-10-18 16:28:20.99--ServerSession(33006544)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--JMX MBeanServer instance found: [weblogic.management.jmx.mbeanserver.WLSMBeanServer@751d58], # of beans: [504], domain: [base_domain] at index: [0]. [EL Finest]: 2010-10-18 16:28:21.0--ServerSession(33006544)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Registered MBean: org.eclipse.persistence.services.mbean.MBeanDevelopmentServices[TopLink:Name=Development-file_/F_/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example,Type=Configuration] [EL Finest]: 2010-10-18 16:28:21.0--ServerSession(33006544)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Registered MBean: org.eclipse.persistence.services.weblogic.MBeanWebLogicRuntimeServices[TopLink:Name=Session(file_/F_/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example)] [EL Finest]: 2010-10-18 16:28:21.0--ServerSession(33006544)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The applicationName for the MBean attached to session [file:/F:/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example] is [org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEAR] [EL Finest]: 2010-10-18 16:28:21.0--ServerSession(33006544)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The moduleName for the MBean attached to session [file:/F:/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example] is [enterprise]
>undeploy EAR [EL Finest]: 2010-10-18 16:38:03.254--ServerSession(33006544)--Thread(Thread[[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Begin undeploying Persistence Unit example; session file:/F:/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example; state Deployed; factoryCount 1 [EL Finest]: 2010-10-18 16:38:03.254--ServerSession(33006544)--Thread(Thread[[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Unregistered MBean [TopLink:Name=Development-file_/F_/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example,Type=Configuration] from MBeanServer [weblogic.management.jmx.mbeanserver.WLSMBeanServer@751d58]. [EL Finest]: 2010-10-18 16:38:03.264--ServerSession(33006544)--Thread(Thread[[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Unregistered MBean [TopLink:Name=Session(file_/F_/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example)] from MBeanServer [weblogic.management.jmx.mbeanserver.WLSMBeanServer@751d58]. >redeploy EAR [EL Finer]: 2010-10-18 16:39:48.307--ServerSession(24802908)--Thread(Thread[[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--JMX MBeanServer instance found: [weblogic.management.jmx.mbeanserver.WLSMBeanServer@751d58], # of beans: [506], domain: [base_domain] at index: [0]. [EL Finest]: 2010-10-18 16:39:48.307--ServerSession(24802908)--Thread(Thread[[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Registered MBean: org.eclipse.persistence.services.mbean.MBeanDevelopmentServices[TopLink:Name=Development-file_/F_/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example,Type=Configuration] [EL Finest]: 2010-10-18 16:39:48.307--ServerSession(24802908)--Thread(Thread[[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Registered MBean: org.eclipse.persistence.services.weblogic.MBeanWebLogicRuntimeServices[TopLink:Name=Session(file_/F_/view_w35e/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/build/classes/_example)]
>One of JBoss, WebSphere, GlassFish regression testing pending...
>see SVN Rev # 8373 (2.1.2) and 8374 (2.2 trunk) https://fisheye2.atlassian.com/changelog/eclipselink/?cs=8373 https://fisheye2.atlassian.com/changelog/eclipselink/?cs=8374
>JBoss 5.0 EAP container testing results OK with http://127.0.0.1:8080/enterprise/FrontController?action=demo 10:14:14,842 INFO [ServerImpl] Release ID: JBoss [EAP] 5.0.0.GA (build: SVNTag=JBPAPP_5_0_0_GA date=200910202128) 10:14:16,656 INFO [ServerInfo] Java version: 1.6.0_17,Sun Microsystems Inc. 10:14:16,656 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_17-b04) 10:14:16,656 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 14.3-b01,Sun Microsystems Inc. 10:14:16,656 INFO [ServerInfo] OS-System: Windows 7 6.1,x86 10:14:16,656 INFO [ServerInfo] VM arguments: -Dprogram.name=run.bat -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dfile.encoding=Cp1252 10:14:37,358 INFO [STDOUT] [EL Warning]: 2010-10-19 10:14:37.348--Thread(Thread[main,5,jboss])--The temporary classLoader for PersistenceLoadProcessor [exampleApplicationManaged] is not available. Switching classLoader to [BaseClassLoader@13641d6{vfszip:/C:/opt/jboss-eap-5.0b/jboss-as/server/default/deploy/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear/}]. Weaving has been disabled for this session. EclipseLink may be unable to get a spec mandated temporary class loader from the server, you may be able to use static weaving as an optional workaround. org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR/ApplicationService/remote-org.eclipse.persistence.example.jpa.server.business.ApplicationServiceRemote - EJB3.x Remote Business Interface 10:15:25,470 INFO [STDOUT] [EL Info]: 2010-10-19 10:15:25.47--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--EclipseLink, version: Eclipse Persistence Services - 2.1.2.qualifier 10:15:25,560 INFO [STDOUT] [EL Warning]: 2010-10-19 10:15:25.56--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--Multiple [2] JMX MBeanServer instances exist, we will use the server at index [0] : [org.jboss.mx.server.MBeanServerImpl@e920f[ defaultDomain='jboss' ]]. 10:15:25,560 INFO [STDOUT] [EL Finer]: 2010-10-19 10:15:25.56--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--JMX MBeanServer instance found: [org.jboss.mx.server.MBeanServerImpl@e920f[ defaultDomain='jboss' ]], # of beans: [1,003], domain: [jboss] at index: [0]. 10:15:25,560 INFO [STDOUT] [EL Warning]: 2010-10-19 10:15:25.56--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--JMX MBeanServer in use: [org.jboss.mx.server.MBeanServerImpl@e920f[ defaultDomain='jboss' ]] from index [0] 10:15:25,560 INFO [STDOUT] [EL Finer]: 2010-10-19 10:15:25.56--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--JMX MBeanServer instance found: [org.jboss.mx.server.MBeanServerImpl@18daedc[ defaultDomain='null' ]], # of beans: [20], domain: [null] at index: [1]. 10:15:25,560 INFO [STDOUT] [EL Finest]: 2010-10-19 10:15:25.56--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--Registered MBean: org.eclipse.persistence.services.mbean.MBeanDevelopmentServices[TopLink:Name=Development-vfszip_/C_/opt/jboss-eap-5.0b/jboss-as/server/default/deploy/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEJB.jar/_example2,Type=Configuration] 10:15:25,560 INFO [STDOUT] [EL Finest]: 2010-10-19 10:15:25.56--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--Registered MBean: org.eclipse.persistence.services.jboss.MBeanJBossRuntimeServices[TopLink:Name=Session(vfszip_/C_/opt/jboss-eap-5.0b/jboss-as/server/default/deploy/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEJB.jar/_example2)] 10:15:25,560 INFO [STDOUT] [EL Finest]: 2010-10-19 10:15:25.56--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--EclipseLink JMX Runtime Services is referencing the [Platform ConversionManager] ClassLoader at: [BaseClassLoader@13641d6{vfszip:/C:/opt/jboss-eap-5.0b/jboss-as/server/default/deploy/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear/}] 10:15:25,560 INFO [STDOUT] [EL Finest]: 2010-10-19 10:15:25.56--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--The applicationName for the MBean attached to session [vfszip:/C:/opt/jboss-eap-5.0b/jboss-as/server/default/deploy/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEJB.jar/_example2] is [org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear] 10:15:25,560 INFO [STDOUT] [EL Finest]: 2010-10-19 10:15:25.56--ServerSession(28902921)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--The moduleName for the MBean attached to session [vfszip:/C:/opt/jboss-eap-5.0b/jboss-as/server/default/deploy/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEJB.jar/_example2] is [_example2]
10209994
>Nightly build is ok Build summary for 2.1.2.v20101019-r8373 SVN Changes since Last Build: ------------------------------------------------------------------------ r8373 | mobrien | 2010-10-18 16:45:35 -0400 (Mon, 18 Oct 2010) TEST-CORE Tests run:7493 Failures:0 Errors:0 TEST-JPA Tests run:2574 Failures:0 Errors:0 --------------------------------------------------------------------------------
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink