camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r923596 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
Date Tue, 16 Mar 2010 07:18:47 GMT
Author: davsclaus
Date: Tue Mar 16 07:18:47 2010
New Revision: 923596

URL: http://svn.apache.org/viewvc?rev=923596&view=rev
Log:
CAMEL-1588: Ups better to keep this OC4j workaround.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=923596&r1=923595&r2=923596&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Tue
Mar 16 07:18:47 2010
@@ -1139,8 +1139,17 @@ public class DefaultCamelContext extends
         getManagementStrategy().start();
 
         // start lifecycle strategies
-        for (LifecycleStrategy strategy : lifecycleStrategies) {
-            strategy.onContextStart(this);
+        Iterator<LifecycleStrategy> it = lifecycleStrategies.iterator();
+        while (it.hasNext()) {
+            LifecycleStrategy strategy = it.next();
+            try {
+                strategy.onContextStart(this);
+            } catch (Exception e) {
+                // not all containers allow access to its MBeanServer (such as OC4j)
+                // so here we remove the troublesome strategy to be able to continue
+                LOG.warn("Cannot start lifecycle strategy: " + strategy + ". This strategy
will be removed. Cause: " + e.getMessage(), e);
+                it.remove();
+            }
         }
 
         // must let some bootstrap service be started before we can notify the starting event



Mime
View raw message