You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/07/06 11:30:40 UTC
[1/3] brooklyn-server git commit: karaf config: enum values are
case-sensitive
Repository: brooklyn-server
Updated Branches:
refs/heads/master 1f2e2a1c4 -> 30573a579
karaf config: enum values are case-sensitive
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/588aebce
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/588aebce
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/588aebce
Branch: refs/heads/master
Commit: 588aebcee7fc659b681ca42f72a502fb5a9a6785
Parents: 4e07826
Author: Aled Sage <al...@gmail.com>
Authored: Tue Jul 5 23:34:39 2016 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Wed Jul 6 11:30:42 2016 +0100
----------------------------------------------------------------------
.../etc/org.apache.brooklyn.osgilauncher.cfg | 24 ++++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/588aebce/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.osgilauncher.cfg
----------------------------------------------------------------------
diff --git a/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.osgilauncher.cfg b/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.osgilauncher.cfg
index fd5525f..24a619a 100644
--- a/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.osgilauncher.cfg
+++ b/karaf/apache-brooklyn/src/main/resources/etc/org.apache.brooklyn.osgilauncher.cfg
@@ -38,22 +38,22 @@
#ignorePersistenceErrors=true
# The high availability mode. Possible values are:
-# - disabled: management node works in isolation - will not cooperate with any other standby/master nodes in management plane;
-# - auto: will look for other management nodes, and will allocate itself as standby or master based on other nodes' states;
-# - master: will startup as master - if there is already a master then fails immediately;
-# - standby: will start up as lukewarm standby with no state - if there is not already a master then fails immediately,
+# - DISABLED: management node works in isolation - will not cooperate with any other standby/master nodes in management plane;
+# - AUTO: will look for other management nodes, and will allocate itself as standby or master based on other nodes' states;
+# - MASTER: will startup as master - if there is already a master then fails immediately;
+# - STANDBY: will start up as lukewarm standby with no state - if there is not already a master then fails immediately,
# and if there is a master which subsequently fails, this node can promote itself;
-# - hot_standby: will start up as hot standby in read-only mode - if there is not already a master then fails immediately,
+# - HOT_STANDBY: will start up as hot standby in read-only mode - if there is not already a master then fails immediately,
# and if there is a master which subseuqently fails, this node can promote itself;
-# - hot_backup: will start up as hot backup in read-only mode - no master is required, and this node will not become a master
-#highAvailabilityMode=disabled
+# - HOT_BACKUP: will start up as hot backup in read-only mode - no master is required, and this node will not become a master
+#highAvailabilityMode=DISABLED
# The persistence mode. Possible values are:
-# - disabled: will not read or persist any state;
-# - auto: will rebind to any existing state, or start up fresh if no state;
-# - rebind: will rebind to the existing state, or fail if no state available;
-# - clean: will start up fresh (removing any existing state)
-#persistMode=disabled
+# - DISABLED: will not read or persist any state;
+# - AUTO: will rebind to any existing state, or start up fresh if no state;
+# - REBIND: will rebind to the existing state, or fail if no state available;
+# - CLEAN: will start up fresh (removing any existing state)
+#persistMode=DISABLED
# The directory to read/write persisted state (or container name if using an object store)
#persistenceDir=
[3/3] brooklyn-server git commit: Closes #231
Posted by sv...@apache.org.
Closes #231
Fix jmxmp connector in karaf
e.g. tomcat failed to reach service-up because it couldn't create the JMXMP connector due to classloading problems.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/30573a57
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/30573a57
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/30573a57
Branch: refs/heads/master
Commit: 30573a57963ef843342cbd4cd6b04064cc23b388
Parents: 1f2e2a1 588aebc
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Wed Jul 6 14:30:20 2016 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Wed Jul 6 14:30:20 2016 +0300
----------------------------------------------------------------------
.../etc/org.apache.brooklyn.osgilauncher.cfg | 24 ++++++++++----------
karaf/features/src/main/feature/feature.xml | 2 +-
.../org/apache/brooklyn/feed/jmx/JmxHelper.java | 24 +++++++++++++++++---
3 files changed, 34 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
[2/3] brooklyn-server git commit: JMX connector: supply classloader
for OSGi bundle
Posted by sv...@apache.org.
JMX connector: supply classloader for OSGi bundle
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/4e078265
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/4e078265
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/4e078265
Branch: refs/heads/master
Commit: 4e078265b3cf278cc8f520e2e902ebd044476e18
Parents: 1f2e2a1
Author: Aled Sage <al...@gmail.com>
Authored: Tue Jul 5 20:25:33 2016 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Wed Jul 6 11:30:42 2016 +0100
----------------------------------------------------------------------
karaf/features/src/main/feature/feature.xml | 2 +-
.../org/apache/brooklyn/feed/jmx/JmxHelper.java | 24 +++++++++++++++++---
2 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4e078265/karaf/features/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/karaf/features/src/main/feature/feature.xml b/karaf/features/src/main/feature/feature.xml
index 057cd3b..b1d7923 100644
--- a/karaf/features/src/main/feature/feature.xml
+++ b/karaf/features/src/main/feature/feature.xml
@@ -211,9 +211,9 @@
<feature name="brooklyn-software-base" version="${project.version}" description="Brooklyn Software Base">
<bundle>mvn:org.apache.brooklyn/brooklyn-software-base/${project.version}</bundle>
+ <bundle dependency="true">wrap:mvn:org.glassfish.external/opendmk_jmxremote_optional_jar/${opendmk_jmxremote_optional_jar.version}</bundle>
<feature>brooklyn-software-winrm</feature>
<feature>brooklyn-policy</feature>
- <!-- python dependency required but not supported since karaf cannot handle its runtime bindings -->
</feature>
<feature name="brooklyn-jmxmp-agent" version="${project.version}" description="Brooklyn Secure JMXMP Agent">
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4e078265/software/base/src/main/java/org/apache/brooklyn/feed/jmx/JmxHelper.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/feed/jmx/JmxHelper.java b/software/base/src/main/java/org/apache/brooklyn/feed/jmx/JmxHelper.java
index d3af18c..d29dee0 100644
--- a/software/base/src/main/java/org/apache/brooklyn/feed/jmx/JmxHelper.java
+++ b/software/base/src/main/java/org/apache/brooklyn/feed/jmx/JmxHelper.java
@@ -20,7 +20,6 @@ package org.apache.brooklyn.feed.jmx;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.apache.brooklyn.util.JavaGroovyEquivalents.groovyTruth;
-import groovy.time.TimeDuration;
import java.io.IOException;
import java.security.KeyStore;
@@ -63,6 +62,7 @@ import javax.net.ssl.TrustManager;
import org.apache.brooklyn.api.entity.EntityLocal;
import org.apache.brooklyn.entity.java.JmxSupport;
import org.apache.brooklyn.entity.java.UsesJmx;
+import org.apache.brooklyn.util.collections.MutableMap;
import org.apache.brooklyn.util.core.crypto.SecureKeys;
import org.apache.brooklyn.util.crypto.SslTrustUtils;
import org.apache.brooklyn.util.exceptions.Exceptions;
@@ -80,6 +80,8 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
+import groovy.time.TimeDuration;
+
public class JmxHelper {
private static final Logger LOG = LoggerFactory.getLogger(JmxHelper.class);
@@ -272,7 +274,7 @@ public class JmxHelper {
JMXServiceURL serviceUrl = new JMXServiceURL(url);
Map env = getConnectionEnvVars();
try {
- connector = JMXConnectorFactory.connect(serviceUrl, env);
+ connector = newConnector(serviceUrl, env);
} catch (NullPointerException npe) {
//some software -- eg WSO2 -- will throw an NPE exception if the JMX connection can't be created, instead of an IOException.
//this is a break of contract with the JMXConnectorFactory.connect method, so this code verifies if the NPE is
@@ -300,9 +302,25 @@ public class JmxHelper {
}
}
+ /**
+ * Handles loading the {@link JMXConnector} in OSGi, where we need to supply the classloader.
+ */
+ public static JMXConnector newConnector(JMXServiceURL url, Map<String, ?> env) throws IOException {
+ Map<String, Object> envCopy = MutableMap.copyOf(env);
+ String protocol = url.getProtocol();
+ if ("jmxmp".equalsIgnoreCase(protocol)) {
+ envCopy.put(JMXConnectorFactory.PROTOCOL_PROVIDER_CLASS_LOADER, javax.management.remote.jmxmp.JMXMPConnector.class.getClassLoader());
+ envCopy.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, javax.management.remote.jmxmp.JMXMPConnector.class.getClassLoader());
+ } else if ("rmi".equalsIgnoreCase(protocol)) {
+ envCopy.put(JMXConnectorFactory.PROTOCOL_PROVIDER_CLASS_LOADER, javax.management.remote.rmi.RMIConnector.class.getClassLoader());
+ envCopy.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, javax.management.remote.rmi.RMIConnector.class.getClassLoader());
+ }
+ return JMXConnectorFactory.connect(url, envCopy);
+ }
+
@SuppressWarnings({ "rawtypes", "unchecked" })
public Map getConnectionEnvVars() {
- Map env = new LinkedHashMap();
+ Map<String, Object> env = new LinkedHashMap();
if (groovyTruth(user) && groovyTruth(password)) {
String[] creds = new String[] {user, password};