diff --git a/artemis-cdi-client/pom.xml b/artemis-cdi-client/pom.xml index 9a8a480c7d8..e6afc1a70d8 100644 --- a/artemis-cdi-client/pom.xml +++ b/artemis-cdi-client/pom.xml @@ -29,6 +29,7 @@ ${project.basedir}/.. + 1.3.2 artemis-cdi-client @@ -83,6 +84,11 @@ javax.inject javax.inject + + javax.annotation + javax.annotation-api + ${javax.annotation.version} + javax.enterprise cdi-api diff --git a/artemis-rest/pom.xml b/artemis-rest/pom.xml index 79ef78e8557..3617a84e503 100644 --- a/artemis-rest/pom.xml +++ b/artemis-rest/pom.xml @@ -128,6 +128,12 @@ jboss-jaxb-api_2.2_spec ${version.jaxb-api} + + org.glassfish.jaxb + jaxb-runtime + 2.3.2 + test + javax.servlet servlet-api diff --git a/pom.xml b/pom.xml index fdaf922b45d..c01992b9398 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ 9.4.3.v20170317 3.6.13.Final 2.4 - 2.8.47 + 2.25.0 4.1.32.Final 2.6 2.0.22.Final diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmx/JmxConnectionTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmx/JmxConnectionTest.java index bb21c92442c..c9ec140d170 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmx/JmxConnectionTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmx/JmxConnectionTest.java @@ -26,9 +26,11 @@ import java.rmi.server.RemoteObject; import java.rmi.server.RemoteRef; -import com.sun.jmx.remote.internal.ProxyRef; +import io.netty.util.internal.PlatformDependent; +import io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess; import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase; import org.junit.Assert; +import org.junit.Assume; import org.junit.Before; import org.junit.Test; import sun.rmi.server.UnicastRef; @@ -47,16 +49,30 @@ public class JmxConnectionTest extends SmokeTestBase { private static final int RMI_REGISTRY_PORT = 10098; public static final String SERVER_NAME_0 = "jmx"; + private Class proxyRefClass; @Before public void before() throws Exception { cleanupData(SERVER_NAME_0); disableCheckThread(); startServer(SERVER_NAME_0, 0, 30000); + try { + final Class aClass = Class.forName("com.sun.jmx.remote.internal.ProxyRef"); + proxyRefClass = aClass; + } catch (ClassNotFoundException ex) { + //try with a shiny new version + try { + final Class aClass = Class.forName("com.sun.jmx.remote.internal.rmi.ProxyRef"); + proxyRefClass = aClass; + } catch (ClassNotFoundException ex2) { + //no op + } + } } @Test public void testJmxConnection() throws Throwable { + Assert.assertNotNull(proxyRefClass); try { // Without this, the RMI server would bind to the default interface IP (the user's local IP mostly) @@ -96,17 +112,22 @@ public void testJmxConnection() throws Throwable { // 3. RemoteObject::getRef is hereby expected to return ProxyRef RemoteRef remoteRef = remoteObject.getRef(); - Assert.assertTrue(remoteRef instanceof ProxyRef); - ProxyRef proxyRef = (ProxyRef) remoteRef; - + Assert.assertTrue(proxyRefClass.isInstance(remoteRef)); // 4. ProxyRef::ref is expected to contain UnicastRef (UnicastRef2 resp.) - Field refField = ProxyRef.class.getDeclaredField("ref"); - refField.setAccessible(true); - remoteRef = (RemoteRef) refField.get(proxyRef); - Assert.assertTrue(remoteRef instanceof UnicastRef); + Field refField = proxyRefClass.getDeclaredField("ref"); + RemoteRef remoteRefField; + try { + refField.setAccessible(true); + remoteRefField = (RemoteRef) refField.get(remoteRef); + } catch (Throwable error) { + Assume.assumeTrue("Unsafe must be available to continue the test", PlatformDependent.hasUnsafe()); + remoteRefField = (RemoteRef) UnsafeAccess.UNSAFE.getObject(remoteRef, UnsafeAccess.UNSAFE.objectFieldOffset(refField)); + } + Assert.assertNotNull(remoteRefField); + Assert.assertTrue(remoteRefField instanceof UnicastRef); // 5. UnicastRef::getLiveRef returns LiveRef - LiveRef liveRef = ((UnicastRef) remoteRef).getLiveRef(); + LiveRef liveRef = ((UnicastRef) remoteRefField).getLiveRef(); Assert.assertEquals(RMI_REGISTRY_PORT, liveRef.getPort()); @@ -119,5 +140,4 @@ public void testJmxConnection() throws Throwable { } } - }