Package org.apache.xmlrpc

Examples of org.apache.xmlrpc.XmlRpcException


                    }
                    return invoke(instance, methodData.method, args);
                }
            }
      }
      throw new XmlRpcException("No method matching arguments: " + Util.getSignature(args));
    }
View Full Code Here


    private Object invoke(Object pInstance, Method pMethod, Object[] pArgs) throws XmlRpcException {
        try {
          return pMethod.invoke(pInstance, pArgs);
      } catch (IllegalAccessException e) {
          throw new XmlRpcException("Illegal access to method "
                                    + pMethod.getName() + " in class "
                                    + clazz.getName(), e);
      } catch (IllegalArgumentException e) {
          throw new XmlRpcException("Illegal argument for method "
                                    + pMethod.getName() + " in class "
                                    + clazz.getName(), e);
      } catch (InvocationTargetException e) {
          Throwable t = e.getTargetException();
            if (t instanceof XmlRpcException) {
View Full Code Here

   * <code>org/apache/xmlrpc/webserver/XmlRpcServlet.properties</code>
   */
  protected XmlRpcHandlerMapping newXmlRpcHandlerMapping() throws XmlRpcException {
    URL url = XmlRpcServlet.class.getResource("XmlRpcServlet.properties");
    if (url == null) {
      throw new XmlRpcException("Failed to locate resource XmlRpcServlet.properties");
    }
    try {
      return newPropertyHandlerMapping(url);
    } catch (IOException e) {
      throw new XmlRpcException("Failed to load resource " + url + ": " + e.getMessage(), e);
    }
  }
View Full Code Here

        data.getConnection().writeErrorHeader(data, pError, -1);
        super.writeError(pConfig, pStream, pError);
        pStream.flush();
      }
    } catch (IOException e) {
      throw new XmlRpcException(e.getMessage(), e);
    }
  }
View Full Code Here

        data.getConnection().writeResponseHeader(data, -1);
        super.writeResponse(pConfig, pStream, pResult);
        pStream.flush();
      }
    } catch (IOException e) {
      throw new XmlRpcException(e.getMessage(), e);
    }
  }
View Full Code Here

            throws XmlRpcException {
        final Class c;
        try {
            c = pClassLoader.loadClass(pClassName);
        } catch (ClassNotFoundException e) {
            throw new XmlRpcException("Unable to load class: " + pClassName, e);
        }
        if (c == null) {
            throw new XmlRpcException(0, "Loading class " + pClassName + " returned null.");
        }
        return c;
    }
View Full Code Here

      byte[] res = (byte[]) super.getResult();
      ByteArrayInputStream bais = new ByteArrayInputStream(res);
      ObjectInputStream ois = new ObjectInputStream(bais);
      return ois.readObject();
    } catch (IOException e) {
      throw new XmlRpcException("Failed to read result object: " + e.getMessage(), e);
    } catch (ClassNotFoundException e) {
      throw new XmlRpcException("Failed to load class for result object: " + e.getMessage(), e);
    }
  }
View Full Code Here

            }
          };
          break;
        } catch (ConnectException e) {
          if (tries >= retries) {
            throw new XmlRpcException("Failed to connect to "
                + hostname + ":" + port + ": " + e.getMessage(), e);
          } else {
                      try {
                          Thread.sleep(delayMillis);
                      } catch (InterruptedException ignore) {
                      }
          }
        }
      }
      sendRequestHeaders(output);
      return output;
    } catch (IOException e) {
      throw new XmlRpcException("Failed to open connection to "
          + hostname + ":" + port + ": " + e.getMessage(), e);
    }
  }
View Full Code Here

  protected void resetClientForRedirect()
            throws XmlRpcException {
      //get the location header to find out where to redirect to
      Header locationHeader = method.getResponseHeader("location");
      if (locationHeader == null) {
            throw new XmlRpcException("Invalid redirect: Missing location header");
      }
      String location = locationHeader.getValue();

      URI redirectUri = null;
      URI currentUri = null;
      try {
          currentUri = method.getURI();
          String charset = currentUri.getProtocolCharset();
          redirectUri = new URI(location, true, charset);
          method.setURI(redirectUri);
      } catch (URIException ex) {
            throw new XmlRpcException(ex.getMessage(), ex);
      }

      //And finally invalidate the actual authentication scheme
      method.getHostAuthState().invalidate();
    }
View Full Code Here

          client.executeMethod(method);
                if (!isRedirectRequired()) {
                    break;
                }
                if (redirectAttempts++ > MAX_REDIRECT_ATTEMPTS) {
                    throw new XmlRpcException("Too many redirects.");
                }
                resetClientForRedirect();
            }
    } catch (XmlRpcIOException e) {
      Throwable t = e.getLinkedException();
      if (t instanceof XmlRpcException) {
        throw (XmlRpcException) t;
      } else {
        throw new XmlRpcException("Unexpected exception: " + t.getMessage(), t);
      }
    } catch (IOException e) {
      throw new XmlRpcException("I/O error while communicating with HTTP server: " + e.getMessage(), e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.XmlRpcException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.