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


Reply via email to