You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2011/12/11 15:23:05 UTC

svn commit: r1213004 - /geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java

Author: xuhaihong
Date: Sun Dec 11 14:23:04 2011
New Revision: 1213004

URL: http://svn.apache.org/viewvc?rev=1213004&view=rev
Log:
GERONIMO-6229 Configuration not found Exception is thrown while accessing EBA portlet page
I did not see an easy way to list the web-contextpath of embedded WABs while the target EBA is stopped, so now EBA portlets will not dispaly those values if the target EBA is stopped.

Modified:
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=1213004&r1=1213003&r2=1213004&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java Sun Dec 11 14:23:04 2011
@@ -307,9 +307,9 @@ public class ConfigManagerPortlet extend
                         }
                     } else if (info.getType() == ConfigurationModuleType.EBA) {
                         Configuration config = configManager.getConfiguration(info.getConfigID());
-                        if(config != null){
-                            for(Map.Entry<AbstractName, GBeanData> entry : config.getGBeans().entrySet()) {                               
-                                if(entry.getKey().getNameProperty(NameFactory.J2EE_TYPE).equals("GBean")) {
+                        if (config != null && configManager.isRunning(info.getConfigID())) {
+                            for(Map.Entry<AbstractName, GBeanData> entry : config.getGBeans().entrySet()) {
+                                if(entry.getKey().getNameProperty("name").equals("AriesApplication")) {
                                     try {
                                         ApplicationGBean applicationGBean = (ApplicationGBean)PortletManager.getKernel().getGBean(entry.getKey());
                                         long[] bundleIds = applicationGBean.getApplicationContentBundleIds();
@@ -317,16 +317,17 @@ public class ConfigManagerPortlet extend
                                         for (long id : bundleIds){
                                             Bundle bundle = bundleContext.getBundle(id);
                                             if (bundle != null && bundle.getHeaders().get("Web-ContextPath") != null){
-                                                details.getContextPaths().add((String)bundle.getHeaders().get("Web-ContextPath"));                                                
+                                                details.getContextPaths().add((String)bundle.getHeaders().get("Web-ContextPath"));
                                             }
-                                        }                                        
-                                    } catch (GBeanNotFoundException e) {                                        
-                                        logger.error("Configuration not found", e);
-                                    } catch (InternalKernelException e) {                                        
-                                        logger.error("Configuration not found", e);
-                                    } catch (IllegalStateException e) {                                        
-                                        logger.error("Configuration not found", e);
-                                    } 
+                                        }
+                                    } catch (GBeanNotFoundException e) {
+                                        logger.error("AriesApplication GBean is not found", e);
+                                    } catch (InternalKernelException e) {
+                                        logger.error("AriesApplication GBean is not found", e);
+                                    } catch (IllegalStateException e) {
+                                        logger.error("AriesApplication GBean is not found", e);
+                                    }
+                                    break;
                                 }
                             }
                         }