geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r263978 - /geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
Date Mon, 29 Aug 2005 00:59:29 GMT
Author: ammulder
Date: Sun Aug 28 17:59:27 2005
New Revision: 263978

URL: http://svn.apache.org/viewcvs?rev=263978&view=rev
Log:
Be more defensive about listen addresses to accomodate errors in
  other GBeans (GERONIMO-939)

Modified:
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java?rev=263978&r1=263977&r2=263978&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
(original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
Sun Aug 28 17:59:27 2005
@@ -205,7 +205,10 @@
                     try {
                         InetSocketAddress addr = (InetSocketAddress) kernel.getAttribute(name,
att.getName());
                         if(addr == null) {
+                            log.debug("No value for GBean "+name+" attribute "+att.getName());
                             continue;
+                        } else if(addr.getAddress() == null || addr.getAddress().getHostAddress()
== null) {
+                            log.debug("Null address or host for GBean "+name+" "+att.getName()+":
"+addr.getAddress());
                         }
                         String attName = info.getName();
                         if(list.size() > 1) {
@@ -243,7 +246,9 @@
             int max = 0;
             for (int i = 0; i < ports.size(); i++) {
                 AddressHolder holder = (AddressHolder) ports.get(i);
-                max = Math.max(max, holder.getAddress().getAddress().getHostAddress().length());
+                if(holder.getAddress().getAddress() != null && holder.getAddress().getAddress().getHostAddress()
!= null) {
+                    max = Math.max(max, holder.getAddress().getAddress().getHostAddress().length());
+                }
             }
             for (int i = 0; i < ports.size(); i++) {
                 AddressHolder holder = (AddressHolder) ports.get(i);
@@ -262,8 +267,10 @@
                     buf.append(' ');
                 }
                 buf.append(holder.getAddress().getPort()).append(' ');
-                buf.append(holder.getAddress().getAddress().getHostAddress());
-                for(int j=holder.getAddress().getAddress().getHostAddress().length(); j<=max;
j++) {
+                String address = holder.getAddress().getAddress() == null || holder.getAddress().getAddress().getHostAddress()
== null ? "" :
+                        holder.getAddress().getAddress().getHostAddress();
+                buf.append(address);
+                for(int j=address.length(); j<=max; j++) {
                     buf.append(' ');
                 }
                 buf.append(holder.getName());



Mime
View raw message