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 Tom Jordahl <to...@macromedia.com> on 2002/05/01 23:11:45 UTC

RE: cvs commit: xml-axis/java/src/org/apache/axis/utils resources .properties

Richard,

I believe these exceptions should NOT be logged as 'info' but rather 'debug'.
This produces noisy output during our functional tests, which means users
will see noisy output for their programs.

--
Tom Jordahl
Macromedia


-----Original Message-----
From: rsitze@apache.org [mailto:rsitze@apache.org]
Sent: Tuesday, April 30, 2002 3:08 PM
To: xml-axis-cvs@apache.org
Subject: cvs commit: xml-axis/java/src/org/apache/axis/utils
resources.properties


rsitze      02/04/30 12:07:31

  Modified:    java/src/org/apache/axis/providers/java EJBProvider.java
                        JavaProvider.java MsgProvider.java
               java/src/org/apache/axis/utils resources.properties
  Log:
  Log exceptions
  
  Revision  Changes    Path
  1.16      +12 -5     xml-axis/java/src/org/apache/axis/providers/java/EJBProvider.java
  
  Index: EJBProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/EJBProvider.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- EJBProvider.java	1 Mar 2002 15:59:16 -0000	1.15
  +++ EJBProvider.java	30 Apr 2002 19:07:31 -0000	1.16
  @@ -55,6 +55,9 @@
   
   package org.apache.axis.providers.java;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +
   import org.apache.axis.AxisFault;
   import org.apache.axis.Handler;
   import org.apache.axis.MessageContext;
  @@ -74,6 +77,9 @@
    */
   public class EJBProvider extends RPCProvider
   {
  +    protected static Log log =
  +        LogFactory.getLog(EJBProvider.class.getName());
  +
       private static final String beanNameOption = "beanJndiName";
       private static final String homeInterfaceNameOption = "homeInterfaceName";
       private static final String remoteInterfaceNameOption = "remoteInterfaceName";
  @@ -232,7 +238,7 @@
        */ 
       private Object getEJBHome(MessageContext msgContext, String beanJndiName) throws AxisFault {
           Handler serviceHandler =  msgContext.getService();
  -        Object ejbHome;
  +        Object ejbHome = null;
           Properties properties = null;
           
           // Set up an InitialContext and use it get the beanJndiName from JNDI
  @@ -248,7 +254,7 @@
               if (username != null) {
                  if (properties == null) properties = new Properties();
                  properties.setProperty(Context.SECURITY_PRINCIPAL,
  -                                  username);
  +                                      username);
               }
   
               // password
  @@ -268,7 +274,7 @@
               if (factoryClass != null) {
                   if (properties == null) properties = new Properties();
                   properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
  -                                   factoryClass);
  +                                       factoryClass);
               }
   
               // contextUrl
  @@ -288,7 +294,7 @@
                   context = new InitialContext(properties);
               } else {
                   if (cached_context == null)
  -                        cached_context = new InitialContext();
  +                    cached_context = new InitialContext();
                   context = cached_context;
               }
               
  @@ -304,10 +310,11 @@
           // Should probably catch javax.naming.NameNotFoundException here 
           catch (Exception exception)
           {
  +            log.info(JavaUtils.getMessage("toAxisFault00"), exception);
               throw AxisFault.makeFault(exception);
           }
           return ejbHome;
       }
   
   
  -}
  \ No newline at end of file
  +}
  
  
  
  1.50      +7 -3      xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
  
  Index: JavaProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- JavaProvider.java	28 Apr 2002 18:10:56 -0000	1.49
  +++ JavaProvider.java	30 Apr 2002 19:07:31 -0000	1.50
  @@ -216,16 +216,18 @@
           String  clsName    = getServiceClassName(service);
           String  allowedMethods = getAllowedMethods(service);
   
  -        if ((clsName == null) || clsName.equals(""))
  +        if ((clsName == null) || clsName.equals("")) {
               throw new AxisFault("Server.NoClassForService",
                   JavaUtils.getMessage("noOption00", getServiceClassNameOptionName(), serviceName),
                   null, null);
  +        }
   
  -        if ((allowedMethods == null) || allowedMethods.equals(""))
  +        if ((allowedMethods == null) || allowedMethods.equals("")) {
               throw new AxisFault("Server.NoMethodConfig",
                   JavaUtils.getMessage("noOption00", 
                                        allowedMethodsOption, serviceName),
                   null, null);
  +        }
   
           if (allowedMethods.equals("*"))
               allowedMethods = null;
  @@ -263,7 +265,7 @@
                              resEnv, jc, obj);
           }
           catch( Exception exp ) {
  -            log.debug( JavaUtils.getMessage("exception00"), exp );
  +            log.info( JavaUtils.getMessage("toAxisFault00"), exp);
               throw AxisFault.makeFault(exp);
           }
           if (log.isDebugEnabled())
  @@ -336,8 +338,10 @@
   
               msgContext.setProperty("WSDL", doc);
           } catch (NoClassDefFoundError e) {
  +            log.info( JavaUtils.getMessage("toAxisFault00"), e );
               throw new AxisFault(e.toString(), e);
           } catch (Exception e) {
  +            log.info( JavaUtils.getMessage("toAxisFault00"), e );
               throw AxisFault.makeFault(e);
           }
       
  
  
  
  1.25      +10 -2     xml-axis/java/src/org/apache/axis/providers/java/MsgProvider.java
  
  Index: MsgProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/MsgProvider.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- MsgProvider.java	23 Apr 2002 16:25:39 -0000	1.24
  +++ MsgProvider.java	30 Apr 2002 19:07:31 -0000	1.25
  @@ -145,8 +145,9 @@
                           resEnv.addBodyElement( new SOAPBodyElement(result[i]));
                   }
                   return ;
  +            } catch( NoSuchMethodException exp ) {
  +                exp2 = exp;
               }
  -            catch( NoSuchMethodException exp ) {exp2 = exp;}
   
               if ( method == null ) {
                 // Try the the simplest case first - just Document as the param 
  @@ -158,8 +159,9 @@
   
                   try {
                       method = jc.getJavaClass().getMethod( methodName, argClasses );
  +                } catch( NoSuchMethodException exp ) {
  +                    exp2 = exp;
                   }
  -                catch( NoSuchMethodException exp ) {exp2 = exp;}
               }
   
               if ( method == null ) {
  @@ -180,7 +182,13 @@
               }    
               catch( NoSuchMethodException exp2 ) {
                   // No match - just throw an error
  +                //
  +                // We do not log the error here, this is
  +                // treated as a catch-rethrow as:
  +                // 1) it's clear where the exception is generated (try-block above)
  +                // 2) we are adding detail to the exception's message.
                   ////////////////////////////////////////////
  +
                   String oldmsg = exp2.getMessage(); 
                   oldmsg = oldmsg == null ? "" : oldmsg;
                   String msg = oldmsg + JavaUtils.getMessage("triedClass00",
  
  
  
  1.93      +2 -0      xml-axis/java/src/org/apache/axis/utils/resources.properties
  
  Index: resources.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/resources.properties,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- resources.properties	23 Apr 2002 22:21:46 -0000	1.92
  +++ resources.properties	30 Apr 2002 19:07:31 -0000	1.93
  @@ -691,6 +691,8 @@
   malformedURLException00=MalformedURLException:
   axisFault00=AxisFault:
   axisFault01=AxisFault: {0}
  +toAxisFault00=Mapping Exception to AxisFault
  +toAxisFault01=Mapping Exception to AxisFault: {0}
   
   # NOTE:  in badSkeleton00, do not translate "--skeletonDeploy" and "--server-side".
   badSkeleton00=Error:  --skeletonDeploy cannot be specified without --server-side.