rombert commented on code in PR #296:
URL: https://github.com/apache/aries/pull/296#discussion_r1861843402


##########
jmx/jmx-mbeanserver-platform/src/main/java/org/apache/aries/jmx/mbean_server/platform/impl/Activator.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.jmx.mbean_server.platform.impl;
+
+import java.lang.management.ManagementFactory;
+import java.util.Hashtable;
+
+import javax.management.Attribute;
+import javax.management.AttributeList;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class Activator implements BundleActivator {
+
+    private final Object registrationLock = new Object();
+    private ServiceRegistration<MBeanServer> registration;
+
+    @Override
+    public void start(BundleContext context) throws Exception {

Review Comment:
   Yes, that makes sense. I tried to bet the reactor build working. It requires 
Java 8 and then the issue with with the pax-exam tests that fail because of 
https://ops4j1.jira.com/browse/PAXURL-352 . I patched in the latest pax-url 
version and added a missing dependency.
   
   ```diff
   diff --git a/jmx/jmx-itests/pom.xml b/jmx/jmx-itests/pom.xml
   index 10f920f17..50f8873e0 100644
   --- a/jmx/jmx-itests/pom.xml
   +++ b/jmx/jmx-itests/pom.xml
   @@ -38,7 +38,7 @@
    
         <properties>
            <exam.version>3.4.0</exam.version>
   -        <url.version>1.6.0</url.version>
   +        <url.version>2.5.3</url.version>
        </properties>
    
        <dependencies>
   @@ -181,6 +181,12 @@
                <version>${url.version}</version>
                <scope>test</scope>
            </dependency>
   +        <dependency>
   +            <groupId>org.apache.geronimo.specs</groupId>
   +            <artifactId>geronimo-atinject_1.0_spec</artifactId>
   +            <version>1.0</version>
   +            <scope>test</scope>
   +        </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
   diff --git a/jmx/jmx-whiteboard/pom.xml b/jmx/jmx-whiteboard/pom.xml
   index 1103faacc..dd708ca9a 100644
   --- a/jmx/jmx-whiteboard/pom.xml
   +++ b/jmx/jmx-whiteboard/pom.xml
   @@ -81,7 +81,7 @@
            </aries.osgi.import.service>
    
            <exam.version>3.4.0</exam.version>
   -        <url.version>1.6.0</url.version>
   +        <url.version>2.5.3</url.version>
        </properties>
    
        <build>
   @@ -192,6 +192,12 @@
                <version>${url.version}</version>
                <scope>test</scope>
            </dependency>
   +        <dependency>
   +            <groupId>org.apache.geronimo.specs</groupId>
   +            <artifactId>geronimo-atinject_1.0_spec</artifactId>
   +            <version>1.0</version>
   +            <scope>test</scope>
   +        </dependency>
            <dependency>
                <groupId>org.ops4j.pax.tinybundles</groupId>
                <artifactId>tinybundles</artifactId>
   ```
   
   With this I get the tests running but most of them fail
   
   ```
   [ERROR] Errors: 
   [ERROR]   BundleStateMBeanTest.testAttributeChangeNotifications » 
ClassNotFound org.osgi.jmx.framework.BundleStateMBean
   [ERROR]   BundleStateMBeanTest.testBundleIDsAttribute » ClassNotFound 
org.osgi.jmx.framework.BundleStateMBean
   [ERROR]   BundleStateMBeanTest.testHeaderLocalization » ClassNotFound 
org.osgi.jmx.framework.BundleStateMBean
   [ERROR]   BundleStateMBeanTest.testMBeanInterface » ClassNotFound 
org.osgi.jmx.framework.BundleStateMBean
   [ERROR]   BundleStateMBeanTest.testObjectName » ClassNotFound 
org.osgi.jmx.framework.BundleStateMBean
   [ERROR]   FrameworkMBeanTest.testGetDependencyClosure » ClassNotFound 
org.osgi.jmx.framework.FrameworkMBean
   [ERROR]   FrameworkMBeanTest.testGetProperty » ClassNotFound 
org.osgi.jmx.framework.FrameworkMBean
   [ERROR]   FrameworkMBeanTest.testMBeanInterface » ClassNotFound 
org.osgi.jmx.framework.FrameworkMBean
   [ERROR]   FrameworkMBeanTest.testObjectName » ClassNotFound 
org.osgi.jmx.framework.FrameworkMBean
   [ERROR]   FrameworkMBeanTest.testRefreshBundleAndWait » ClassNotFound 
org.osgi.jmx.framework.FrameworkMBean
   [ERROR]   FrameworkMBeanTest.testRefreshBundlesAndWait » ClassNotFound 
org.osgi.jmx.framework.FrameworkMBean
   [ERROR]   FrameworkMBeanTest.testRefreshBundlesAndWait2 » ClassNotFound 
org.osgi.jmx.framework.FrameworkMBean
   [ERROR]   
PackageStateMBeanTest.doSetUp:59->AbstractIntegrationTest.waitForMBean:172->AbstractIntegrationTest.waitForMBean:189
 » Runtime osgi.core:type=packageState,version=1.5 mbean is not available after 
waiting 20 seconds
   [ERROR]   
PackageStateMBeanTest.doSetUp:59->AbstractIntegrationTest.waitForMBean:172->AbstractIntegrationTest.waitForMBean:189
 » Runtime osgi.core:type=packageState,version=1.5 mbean is not available after 
waiting 20 seconds
   [ERROR]   ServiceStateMBeanTest.testAttributeChangeNotifications » 
ClassNotFound org.osgi.jmx.framework.ServiceStateMBean
   [ERROR]   ServiceStateMBeanTest.testGetServiceAndGetProperty » ClassNotFound 
org.osgi.jmx.framework.ServiceStateMBean
   [ERROR]   ServiceStateMBeanTest.testGetServiceIds » ClassNotFound 
org.osgi.jmx.framework.ServiceStateMBean
   [ERROR]   ServiceStateMBeanTest.testListServices » ClassNotFound 
org.osgi.jmx.framework.ServiceStateMBean
   [ERROR]   ServiceStateMBeanTest.testListServicesSelectiveItems » 
ClassNotFound org.osgi.jmx.framework.ServiceStateMBean
   [ERROR]   ServiceStateMBeanTest.testMBeanInterface » ClassNotFound 
org.osgi.jmx.framework.ServiceStateMBean
   [ERROR]   ServiceStateMBeanTest.testObjectName » ClassNotFound 
org.osgi.jmx.framework.ServiceStateMBean
   [ERROR]   ServiceStateMBeanTest.testServicePropertiesInListServices » 
ClassNotFound org.osgi.jmx.framework.ServiceStateMBean
   [ERROR]   BundleWiringStateMBeanTest.testCurrentWiringClosure » 
ClassNotFound org.osgi.jmx.framework.wiring.BundleWiringStateMBean
   [ERROR]   
BundleWiringStateMBeanTest.testGetCurrentRevisionDeclaredCapabilities » 
ClassNotFound org.osgi.jmx.framework.wiring.BundleWiringStateMBean
   [ERROR]   
BundleWiringStateMBeanTest.testGetCurrentRevisionDeclaredRequirements » 
ClassNotFound org.osgi.jmx.framework.wiring.BundleWiringStateMBean
   [ERROR]   BundleWiringStateMBeanTest.testGetCurrentWiring » ClassNotFound 
org.osgi.jmx.framework.wiring.BundleWiringStateMBean
   [ERROR]   BundleWiringStateMBeanTest.testGetRevisionsDeclaredCapabilities » 
ClassNotFound org.osgi.jmx.framework.wiring.BundleWiringStateMBean
   [ERROR]   BundleWiringStateMBeanTest.testGetRevisionsDeclaredRequirements » 
ClassNotFound org.osgi.jmx.framework.wiring.BundleWiringStateMBean
   [ERROR]   BundleWiringStateMBeanTest.testObjectName » ClassNotFound 
org.osgi.jmx.framework.wiring.BundleWiringStateMBean
   [ERROR]   BundleWiringStateMBeanTest.testRevisionsWiring » ClassNotFound 
org.osgi.jmx.framework.wiring.BundleWiringStateMBean
   [ERROR]   BundleWiringStateMBeanTest.testRevisionsWiringClosure » 
ClassNotFound org.osgi.jmx.framework.wiring.BundleWiringStateMBean
   [ERROR]   PermissionAdminMBeanTest.testMBeanInterface:54 » ClassNotFound 
org.osgi.jmx.service.permissionadmin.PermissionAdminMBean
   [INFO] 
   [ERROR] Tests run: 36, Failures: 0, Errors: 32, Skipped: 2
   ```
   
   I looked into the Pax-Exam test output but I don't understand what is going 
wrong. Some snippets seem to suggest that not all the Aries JMX bundles resolve 
but I'm not sure how to figure out the root cause. Would you have an idea?
   
   ```
   10:38:17.713 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.exam.link'}'}
   10:38:17.713 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.exam.inject.link'}'}
   10:38:17.714 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.extender.service.link'}'}
   10:38:17.714 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.osgi.compendium.link'}'}
   10:38:17.714 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.logging.api.link'}'}
   10:38:17.714 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.base.link'}'}
   10:38:17.715 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.swissbox.core.link'}'}
   10:38:17.715 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.swissbox.extender.link'}'}
   10:38:17.716 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.swissbox.framework.link'}'}
   10:38:17.716 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.swissbox.lifecycle.link'}'}
   10:38:17.716 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.swissbox.tracker.link'}'}
   10:38:17.717 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.apache.geronimo.specs.atinject.link'}'}
   10:38:17.717 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@2) 
JUnitBundlesOption{url=link:classpath:META-INF/links/org.ops4j.pax.tipi.junit.link}
   10:38:17.717 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.tipi.hamcrest.core.link'}'}
   10:38:17.717 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) 
UrlProvisionOption{url='RawUrlReference{url='link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link'}'}
   10:38:17.718 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) MavenArtifactUrlReference{groupId='org.osgi', 
artifactId='org.osgi.compendium', version='4.3.1', type='null'}
   10:38:17.718 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) MavenArtifactUrlReference{groupId='org.apache.aries', 
artifactId='org.apache.aries.util', version='1.0.0', type='null'}
   10:38:17.719 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) MavenArtifactUrlReference{groupId='org.apache.felix', 
artifactId='org.apache.felix.configadmin', version='1.8.0', type='null'}
   10:38:17.719 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) MavenArtifactUrlReference{groupId='org.apache.aries.jmx', 
artifactId='org.apache.aries.jmx', version='1.1.6-SNAPSHOT', type='null'}
   10:38:17.719 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) MavenArtifactUrlReference{groupId='org.apache.aries.jmx', 
artifactId='org.apache.aries.jmx.core.whiteboard', version='1.1.7-SNAPSHOT', 
type='null'}
   10:38:17.719 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) MavenArtifactUrlReference{groupId='org.apache.aries.jmx', 
artifactId='org.apache.aries.jmx.api', version='1.1.6-SNAPSHOT', type='null'}
   10:38:17.720 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) MavenArtifactUrlReference{groupId='org.apache.aries.jmx', 
artifactId='org.apache.aries.jmx.whiteboard', version='1.1.6-SNAPSHOT', 
type='null'}
   10:38:17.720 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) MavenArtifactUrlReference{groupId='org.apache.aries.testsupport', 
artifactId='org.apache.aries.testsupport.unit', version='2.0.0-SNAPSHOT', 
type='null'}
   10:38:17.720 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) 
UrlProvisionOption{url='RawUrlReference{url='file:/tmp/ops4j-store-anonymous-2226271183744275890/tinybundles_9469795b111d7975b864956cc60e1f9e3531f082.bin'}'}
   10:38:17.721 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - + Install 
(start@3) 
UrlProvisionOption{url='RawUrlReference{url='file:/tmp/ops4j-store-anonymous-5461496698858606604/tinybundles_2be0ea4f48bd9f66c6ee00f112829b0522c7884f.bin'}'}
   10:38:17.721 [main] DEBUG o.o.p.e.forked.ForkedTestContainer - Jump to 
startlevel [5]
   
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] 
: Enabling SLF4J API support.
   
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] 
: Enabling Jakarta Commons Logging API support.
   
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] 
: Enabling Log4J API support.
   
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] 
: Enabling Avalon Logger API support.
   
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] 
: Enabling JULI Logger API support.
   10:38:17.774 [main] ERROR o.o.p.e.forked.ForkedTestContainer - Bundle [19] 
is not resolved
   10:38:17.774 [main] ERROR o.o.p.e.forked.ForkedTestContainer - Bundle [20] 
is not resolved
   10:38:17.774 [main] ERROR o.o.p.e.forked.ForkedTestContainer - Bundle [21] 
is not resolved
   10:38:17.774 [main] ERROR o.o.p.e.forked.ForkedTestContainer - Bundle [22] 
is not resolved
   10:38:17.774 [main] ERROR o.o.p.e.forked.ForkedTestContainer - Bundle [25] 
is not resolved
   ``` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@aries.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to