You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by to...@apache.org on 2004/10/27 21:50:54 UTC

cvs commit: ws-axis/java/src/org/apache/axis/management Registrar.java

tomj        2004/10/27 12:50:54

  Modified:    java/src/org/apache/axis/management Registrar.java
  Log:
  Silently ignore the case where commons-modeler.jar isn't around.
  Change the errors to warnings and include a bit of explainitory text.
  
  Revision  Changes    Path
  1.4       +9 -4      ws-axis/java/src/org/apache/axis/management/Registrar.java
  
  Index: Registrar.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/management/Registrar.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Registrar.java	25 Feb 2004 14:02:42 -0000	1.3
  +++ Registrar.java	27 Oct 2004 19:50:54 -0000	1.4
  @@ -164,8 +164,15 @@
            */
           private boolean bindToModeler() {
               Exception ex = null;
  +            Class clazz;
  +            try {
  +                clazz = Class.forName("org.apache.commons.modeler.Registry");
  +            } catch (ClassNotFoundException e) {
  +                // just ignore it silently if we don't have commons-modeler.jar around
  +                registry = null;
  +                return false;
  +            }
               try {
  -                Class clazz = Class.forName("org.apache.commons.modeler.Registry");
                   Class[] getRegistryArgs = new Class[]{Object.class, Object.class, };
                   Method getRegistry = clazz.getMethod("getRegistry", getRegistryArgs);
                   Object[] getRegistryOptions = new Object[]{null, null};
  @@ -181,15 +188,13 @@
                   ex = e;
               } catch (InvocationTargetException e) {
                   ex = e;
  -            } catch (ClassNotFoundException e) {
  -                ex = e;
               } catch (NoSuchMethodException e) {
                   ex = e;
               }
               // handle any of these exceptions
               if (ex != null) {
                   //log the error
  -                log.error(ex);
  +                log.warn("Unable to initialize commons-modeler Registry.", ex);
                   //mark the registration as a failure
                   registry = null;
                   //and fail