axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/transport/http AxisServlet.java
Date Fri, 21 Jun 2002 19:48:40 GMT
dims        2002/06/21 12:48:40

  Modified:    java/src/org/apache/axis MessageContext.java
               java/src/org/apache/axis/handlers/soap SOAPService.java
               java/src/org/apache/axis/message BodyBuilder.java
                        RPCElement.java
               java/src/org/apache/axis/transport/http AxisServlet.java
  Log:
  Related to Bug 10071 (Exception contacting deployed service).
  - ClassNotFoundException should be sent to the client-side instead of java.io.IOException.
  
  Revision  Changes    Path
  1.104     +2 -2      xml-axis/java/src/org/apache/axis/MessageContext.java
  
  Index: MessageContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/MessageContext.java,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- MessageContext.java	19 Jun 2002 16:13:16 -0000	1.103
  +++ MessageContext.java	21 Jun 2002 19:48:39 -0000	1.104
  @@ -201,7 +201,7 @@
           currentOperation = operation;
       }
   
  -    public OperationDesc [] getPossibleOperationsByQName(QName qname)
  +    public OperationDesc [] getPossibleOperationsByQName(QName qname) throws AxisFault
       {
           if (currentOperation != null) {
               return new OperationDesc [] { currentOperation };
  @@ -237,7 +237,7 @@
           return possibleOperations;
       }
   
  -    public OperationDesc getOperationByQName(QName qname)
  +    public OperationDesc getOperationByQName(QName qname) throws AxisFault
       {
           if (currentOperation == null) {
               OperationDesc [] possibleOperations = getPossibleOperationsByQName(qname);
  
  
  
  1.68      +3 -3      xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java
  
  Index: SOAPService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- SOAPService.java	20 Jun 2002 16:48:19 -0000	1.67
  +++ SOAPService.java	21 Jun 2002 19:48:40 -0000	1.68
  @@ -272,7 +272,7 @@
           return serviceDescription;
       }
   
  -    public synchronized ServiceDesc getInitializedServiceDesc(MessageContext msgContext)
{
  +    public synchronized ServiceDesc getInitializedServiceDesc(MessageContext msgContext)
throws AxisFault {
           if (serviceDescription.getImplClass() == null) {
               String clsName = (String)getOption(JavaProvider.OPTION_CLASSNAME);
   
  @@ -291,7 +291,7 @@
                           serviceDescription.setImplClass(jc.getJavaClass());
                       } catch (ClassNotFoundException e) {
                           log.error(JavaUtils.getMessage("exception00"), e);
  -                        return null;
  +                        throw new AxisFault(JavaUtils.getMessage("noClassForService00",
clsName), e);
                       }
                   } else {
                       try {
  @@ -299,7 +299,7 @@
                           serviceDescription.setImplClass(cls);
                       } catch (ClassNotFoundException e) {
                           log.error(JavaUtils.getMessage("exception00"), e);
  -                        return null; // FIXME - throw?
  +                        throw new AxisFault(JavaUtils.getMessage("noClassForService00",
clsName), e);
                       }
                   }
                   TypeMapping tm;
  
  
  
  1.37      +9 -2      xml-axis/java/src/org/apache/axis/message/BodyBuilder.java
  
  Index: BodyBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/BodyBuilder.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- BodyBuilder.java	11 Jun 2002 14:53:58 -0000	1.36
  +++ BodyBuilder.java	21 Jun 2002 19:48:40 -0000	1.37
  @@ -137,7 +137,14 @@
           if ((root != null) && root.equals("0")) isRoot = false;
   
           MessageContext msgContext = context.getMessageContext();
  -        OperationDesc [] operations = msgContext.getPossibleOperationsByQName(qname);
  +        OperationDesc [] operations = null;
  +        try {
  +             operations = msgContext.getPossibleOperationsByQName(qname);
  +        } catch (org.apache.axis.AxisFault e) {
  +            // SAXException is already known to this method, so I
  +            // don't have an exception-handling propogation explosion.
  +            throw new SAXException(e);
  +        }
   
           /** Now we make a plain SOAPBodyElement IF we either:
            * a) have an non-root element, or
  @@ -160,7 +167,7 @@
                       element = new RPCElement(namespace, localName, prefix,
                               attributes, context, operations);
                       
  -                } catch (ClassNotFoundException e) {
  +                } catch (org.apache.axis.AxisFault e) {
                       // SAXException is already known to this method, so I
                       // don't have an exception-handling propogation explosion.
                       //
  
  
  
  1.64      +3 -2      xml-axis/java/src/org/apache/axis/message/RPCElement.java
  
  Index: RPCElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCElement.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- RPCElement.java	11 Jun 2002 14:53:58 -0000	1.63
  +++ RPCElement.java	21 Jun 2002 19:48:40 -0000	1.64
  @@ -55,6 +55,7 @@
   
   package org.apache.axis.message;
   
  +import org.apache.axis.AxisFault;
   import org.apache.axis.Constants;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  @@ -85,7 +86,7 @@
                         String prefix,
                         Attributes attributes,
                         DeserializationContext context,
  -                      OperationDesc [] operations) throws ClassNotFoundException
  +                      OperationDesc [] operations) throws AxisFault
       {
           super(namespace, localName, prefix, attributes, context);
   
  @@ -106,7 +107,7 @@
                   
                   String lc = Utils.xmlNameToJava(name);
                   if (serviceDesc == null) {
  -                    throw new ClassNotFoundException(JavaUtils.getMessage("noClassForService00",
lc));
  +                    AxisFault.makeFault(new ClassNotFoundException(JavaUtils.getMessage("noClassForService00",
lc)));
                   }
   
                   operations = serviceDesc.getOperationsByName(lc);
  
  
  
  1.116     +2 -20     xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- AxisServlet.java	18 Jun 2002 15:12:24 -0000	1.115
  +++ AxisServlet.java	21 Jun 2002 19:48:40 -0000	1.116
  @@ -565,14 +565,11 @@
                   // It's been suggested that a lack of SOAPAction
                   // should produce some other error code (in the 400s)...
                   res.setStatus(getHttpServletResponseStatus(e));
  -                responseMsg =
  -                    generateFaultResponse(msgContext.getRequestMessage(), e);
  +                responseMsg = new Message(e);
               } catch (Exception e) {
                   log.error(JavaUtils.getMessage("exception00"), e);
                   res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
  -                responseMsg =
  -                    generateFaultResponse(msgContext.getRequestMessage(),
  -                                          AxisFault.makeFault(e));
  +                responseMsg = new Message(AxisFault.makeFault(e));
               }
           } catch (AxisFault fault) {
               log.error(JavaUtils.getMessage("axisFault00"), fault);
  @@ -604,21 +601,6 @@
                   : HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
       }
   
  -
  -    /**
  -     * Should never generate an exception, but if it does
  -     * we want to be able to see evidence of it for tracing purpose
  -     */
  -    private Message generateFaultResponse(Message msg, AxisFault responseFault)
  -        throws AxisFault
  -    {
  -        SOAPEnvelope env = msg.getSOAPEnvelope();
  -        env.clearBody();
  -        env.addBodyElement(new SOAPFaultElement(responseFault));
  -        
  -        return msg;
  -    }
  -    
       private void sendResponse(final String clientVersion,
               HttpServletResponse res, Message responseMsg)
           throws AxisFault, IOException
  
  
  

Mime
View raw message