Examples of InternalServerErrorException


Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

        retVal = getReturnedValue(request, getReturnWriter().writeValueAsString(rtn));
      }
    }
    catch (Exception e)
    {
      throw new InternalServerErrorException("Error serializing rest service return", "Error processing requested service", e);
    }
    return new MethodReturn(hasReturnType, retVal, exeptionData, cacheInfo, null, isEtagGenerationEnabled());
  }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

    {
      return EncryptUtils.hash(s);
    }
    catch (NoSuchAlgorithmException ns)
    {
      throw new InternalServerErrorException("Error generating MD5 hash for String["+s+"]", "Error processing requested service", ns);
    }
  }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

  public Object inject(HttpRequest request)
  {
    List<String> list = request.getUri().getPathParameters(true).get(paramName);
    if (list == null)
    {
      throw new InternalServerErrorException("Unknown @PathParam: " + paramName + " for path: " + request.getUri().getPath(), "Can not execute requested service with informed params.");
    }
    if (list != null && list.size() > 0)
    {
      return extractValue(list.get(list.size() - 1));
    }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

  public GroupValueInjector(RestParameterType restParameterType, Type type, String paramPrefix)
    {
    this.baseClass = ClassUtils.getRawType(type);
    if (!isAllowedComplexType(baseClass))
    {
      throw new InternalServerErrorException("Invalid rest parameter for rest method: " + baseClass.getCanonicalName() + ". Type not allowed for " +
          "this type of parameter. It can only be passed as a body parameter", "Can not execute requested service");
    }
    List<PropertyInfo> writeableProperties = new ArrayList<PropertyInfo>();
    PropertyInfo[] properties = ClassUtils.extractBeanPropertiesInfo(type);
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

    {
      throw (RestFailure)cause;
    }
    else
    {
      throw new InternalServerErrorException("Can not execute requested service. Unchecked Exception occurred on method: "+method.toString(),
          "Can not execute requested service", cause);
    }
    }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

      Object result = method.invoke(resource, args);
      return result;
    }
    catch (IllegalAccessException e)
    {
      throw new InternalServerErrorException("Not allowed to reflect on method: " + method.toString(), "Can not execute requested service", e);
    }
    catch (InvocationTargetException e)
    {
      return restErrorHandler.handleError(e);
    }
    catch (IllegalArgumentException e)
    {
      String msg = "Bad arguments passed to " + method.toString() + "  (";
      if (args != null)
      {
        boolean first = false;
        for (Object arg : args)
        {
          if (!first)
          {
            first = true;
          }
          else
          {
            msg += ",";
          }
          if (arg == null)
          {
            msg += " null";
            continue;
          }
          msg += " " + arg.getClass().getName();
        }
      }
      msg += " )";
      throw new InternalServerErrorException(msg, "Can not execute requested service", e);
    }
  }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

          }
          if (paramInjector instanceof MessageBodyParamInjector)
          {
          if (hasBodyParam)
          {
            throw new InternalServerErrorException("Invalid rest method: " + method.toString() + ". Can not receive " +
                "more than one parameter through body text", "Can not execute requested service");
          }
            hasBodyParam = true;
          }
        }

    if (hasBodyParam && hasFormParam)
    {
      throw new InternalServerErrorException("Invalid rest method: " + method.toString() + ". Can not use both " +
          "types on the same method: FormParam and BodyParam", "Can not execute requested service");
    }
    if ((hasBodyParam || hasFormParam) && httpMethod.equals("GET"))
    {
      throw new InternalServerErrorException("Invalid rest method: " + method.toString() + ". Can not receive " +
          "parameters on body for GET methods.", "Can not execute requested service");
    }
    }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

        try
        {
          methodRegistrationInfo = processMethod(base, clazz, method, restMethodNames)
        } catch (Exception e)
        {
          throw new InternalServerErrorException("Error to processMethod: " + method.toString(), "Can not execute requested service", e);
        }
        if (methodRegistrationInfo != null)
        {
          List<RestMethodRegistrationInfo> methodsForPath = validRestMethods.get(methodRegistrationInfo.pathExpression);
          if (methodsForPath == null)
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

    {
      if (rm.getHttpMethod() != null && rm.getHttpMethod().equals(httpMethod))
      {
        if (invoker != null)
        {
          throw new InternalServerErrorException("More than one method is bound to the same REST operation (URI + Method Type)", "Error processing requested operation.");
        }
        invoker = rm;
      }
    }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.InternalServerErrorException

      restErrorHandler.setMethod(method);
      return restErrorHandler;
    }
    catch(Exception e)
    {
      throw new InternalServerErrorException("Can not execute requested service. Error initializing rest error handler: "+restErrorHandlerClass.getCanonicalName(),
          "Can not execute requested service", e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.