maguro      2005/03/20 18:13:32

  Modified:    modules/core/src/java/org/openejb/corba/util
                        ClasspathTieLoader.java OpenORBStubClassLoader.java
                        Util.java UtilDelegateImpl.java
  Log:

  Better debug msgs.
  
  Revision  Changes    Path
  1.5       +16 -3     
openejb/modules/core/src/java/org/openejb/corba/util/ClasspathTieLoader.java
  
  Index: ClasspathTieLoader.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/util/ClasspathTieLoader.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ClasspathTieLoader.java   18 Mar 2005 08:26:10 -0000      1.4
  +++ ClasspathTieLoader.java   20 Mar 2005 23:13:32 -0000      1.5
  @@ -44,6 +44,8 @@
    */
   package org.openejb.corba.util;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   import org.omg.PortableServer.Servant;
   
   import org.apache.geronimo.gbean.GBeanInfo;
  @@ -61,8 +63,13 @@
    */
   public class ClasspathTieLoader implements TieLoader {
   
  +    private final Log log = LogFactory.getLog(ClasspathTieLoader.class);
  +
       public Servant loadTieClass(Class itf, ClassLoader cl) throws 
CORBAException {
  +
           String name = itf.getName();
  +        String stubName = "";
  +
           try {
               int namepos = name.lastIndexOf('.');
               String packagename, classname;
  @@ -74,14 +81,20 @@
                   packagename = name.substring(0, namepos + 1);
                   classname = name.substring(namepos + 1);
               }
  -            String stubName = packagename + "_" + classname + "_Tie";
  +
  +            stubName = packagename + "_" + classname + "_Tie";
  +
  +            if (log.isDebugEnabled()) log.debug("Loading TIE class " + 
stubName + " for " + name);
   
               return (Servant) cl.loadClass(stubName).newInstance();
           } catch (InstantiationException e) {
  +            log.error("Unable to load TIE class " + stubName + " for " + 
name);
               throw new CORBAException(e);
           } catch (IllegalAccessException e) {
  +            log.error("Unable to load TIE class " + stubName + " for " + 
name);
               throw new CORBAException(e);
           } catch (ClassNotFoundException e) {
  +            log.error("Unable to load TIE class " + stubName + " for " + 
name);
               throw new CORBAException(e);
           }
       }
  
  
  
  1.6       +7 -3      
openejb/modules/core/src/java/org/openejb/corba/util/OpenORBStubClassLoader.java
  
  Index: OpenORBStubClassLoader.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/util/OpenORBStubClassLoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- OpenORBStubClassLoader.java       18 Mar 2005 08:26:10 -0000      1.5
  +++ OpenORBStubClassLoader.java       20 Mar 2005 23:13:32 -0000      1.6
  @@ -134,8 +134,10 @@
                           url = file.toURL();
                           nameToClassMap.put(name, url);
                       } catch (IOException e) {
  +                        log.error("Unable to generate stub", e);
                           throw new ClassNotFoundException("Unable to generate 
stub", e);
                       } catch (CompilerException e) {
  +                        log.error("Unable to generate stub", e);
                           throw new ClassNotFoundException("Unable to generate 
stub", e);
                       }
                   }
  @@ -146,11 +148,13 @@
               }
   
               result = loader.loadClass(name);
  +            assert result != null;
   
  -            if (log.isDebugEnabled()) log.debug("result: " + (result == null 
? "NULL" : result.getName()));
  +            if (log.isDebugEnabled()) log.debug("result: " + 
result.getName());
               return result;
   
           }
  +        if (log.isDebugEnabled()) log.debug("Could not load class: " + name);
           throw new ClassNotFoundException("Could not load class: " + name);
       }
   
  
  
  
  1.3       +16 -1     
openejb/modules/core/src/java/org/openejb/corba/util/Util.java
  
  Index: Util.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/util/Util.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Util.java 8 Mar 2005 04:08:28 -0000       1.2
  +++ Util.java 20 Mar 2005 23:13:32 -0000      1.3
  @@ -381,4 +381,19 @@
           }
           return result;
       }
  +
  +    public static String byteToString(byte[] data) {
  +        StringBuffer buffer = new StringBuffer();
  +        for (int i = 0; i < data.length; i++) {
  +            buffer.append(HEXCHAR[(data[i]>>>4)&0x0F]);
  +            buffer.append(HEXCHAR[(data[i]    )&0x0F]);
  +        }
  +        return buffer.toString();
  +
  +    }
  +
  +    private static final char[] HEXCHAR = {
  +        '0', '1', '2', '3', '4', '5', '6', '7',
  +        '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
  +    };
   }
  
  
  
  1.6       +8 -3      
openejb/modules/core/src/java/org/openejb/corba/util/UtilDelegateImpl.java
  
  Index: UtilDelegateImpl.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/util/UtilDelegateImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- UtilDelegateImpl.java     15 Mar 2005 05:27:07 -0000      1.5
  +++ UtilDelegateImpl.java     20 Mar 2005 23:13:32 -0000      1.6
  @@ -208,7 +208,12 @@
           if (result == null && classLoader != null) {
               if (log.isDebugEnabled()) log.debug("Attempting to load " + 
className + " from the static class loader");
   
  -            result = classLoader.loadClass(className);
  +            try {
  +                result = classLoader.loadClass(className);
  +            } catch (ClassNotFoundException e) {
  +                if (log.isDebugEnabled()) log.debug("Unable to load " + 
className + " from the static class loader", e);
  +                throw e;
  +            }
   
               if (log.isDebugEnabled()) log.debug("result: " + (result == null 
? "NULL" : result.getName()));
           }
  
  
  

Reply via email to