Examples of MarshallException


Examples of com.metaparadigm.jsonrpc.MarshallException

    } else if (geometry instanceof MultiLineString) {
      obj = fromMultiLineString((MultiLineString) geometry);
    } else if (geometry instanceof MultiPoint) {
      obj = fromMultiPoint((MultiPoint) geometry);
    } else {
      throw new MarshallException("cannot marshal " + geometry.getClass());
    }
    return obj;
  }
View Full Code Here

Examples of com.metaparadigm.jsonrpc.MarshallException

    BeanSerializerState beanState;
    try {
      beanState = (BeanSerializerState) state.get(BeanSerializerState.class);
    } catch (Exception e) {
      e.printStackTrace();
      throw new MarshallException("bean serializer internal error : " + e.getMessage());
    }
    Integer identity = System.identityHashCode(o);
    if (beanState.beanSet.contains(identity)) {
      throw new MarshallException("circular reference");
    }
    beanState.beanSet.add(identity);

    BeanData bd;
    try {
      bd = getBeanData(o.getClass());
    } catch (IntrospectionException e) {
      throw new MarshallException(o.getClass().getName() + " is not a bean");
    }

    JSONObject val = new JSONObject();
    if (ser.getMarshallClassHints()) {
      val.put("javaClass", o.getClass().getName());
    }
    Iterator i = bd.readableProps.entrySet().iterator();
    Object[] args = new Object[0];
    Object result;
    while (i.hasNext()) {
      Map.Entry ent = (Map.Entry) i.next();
      String prop = (String) ent.getKey();
      Method getMethod = (Method) ent.getValue();
      log.debug("invoking {}()", getMethod.getName());
      try {
        result = getMethod.invoke(o, args);
      } catch (Throwable e) {
        if (e instanceof InvocationTargetException) {
          e = ((InvocationTargetException) e).getTargetException();
        }
        throw new MarshallException("bean " + o.getClass().getName() + " can't invoke "
            + getMethod.getName() + ": " + e.getMessage());
      }
      try {
        if (result != null || ser.getMarshallNullAttributes()) {

          val.put(prop, ser.marshall(state, result));
        }
      } catch (MarshallException e) {
        throw new MarshallException("bean " + o.getClass().getName() + " " + e.getMessage());
      }
    }

    beanState.beanSet.remove(identity);
    return val;
View Full Code Here

Examples of org.directwebremoting.extend.MarshallException

                String id = LocalUtil.decode(data.getValue());
                Assert.isEncrypted(decipherer, id);
                return new UUID(decipherer.decrypt(id));
            }
        } catch (Exception e) {
            throw new MarshallException(paramType, new IWebMvcException("Could not convert UUID from: " + data, e));
        }
        return null;
    }
View Full Code Here

Examples of org.directwebremoting.extend.MarshallException

    public OutboundVariable convertOutbound(Object data, OutboundContext ctx) throws MarshallException {
        if (decipherer == null) initEncryption();
        try {
            return new NonNestedOutboundVariable("'" + cipherer.encrypt(((UUID) data).toString()) + "'");
        } catch (Exception e) {
            throw new MarshallException(data.getClass(), new IWebMvcException("Could not generate encrypted UUID from: " + data, e));
        }
    }
View Full Code Here

Examples of org.directwebremoting.extend.MarshallException

        String className = LocalUtil.decode(data.getValue());
        try {
            Assert.isEncrypted(decipherer, className);
            return ClassUtils.forName(decipherer.decrypt(className));
        } catch (Exception cne) {
            throw new MarshallException(paramType, new IWebMvcException("Could not convert class from: " + className, cne));
        }
    }
View Full Code Here

Examples of org.directwebremoting.extend.MarshallException

    public OutboundVariable convertOutbound(Object data, OutboundContext ctx) throws MarshallException {
        if (decipherer == null) initEncryption();
        try {
            return new NonNestedOutboundVariable("'" + cipherer.encrypt(((Class<?>) data).getName()) + "'");
        } catch (Exception e) {
            throw new MarshallException(data.getClass(), new IWebMvcException("Could not generate encrypted class name from: " + data, e));
        }
    }
View Full Code Here

Examples of org.jabsorb.serializer.MarshallException

            result = readMethod.invoke(o, (Object[]) null);
          } catch (Throwable e) {
            if (e instanceof InvocationTargetException)
              e = ((InvocationTargetException) e)
                  .getTargetException();
            throw new MarshallException("bean "
                + o.getClass().getName() + " can't invoke "
                + readMethod.getName() + ": " + e.getMessage());
          }

          try {
            if (result != null || ser.getMarshallNullAttributes())
              jso
                  .put(prop.getName(), ser.marshall(state, null,result,new Integer(0)));
          } catch (MarshallException e) {
            throw new MarshallException("bean "
                + o.getClass().getName() + " " + e.getMessage());
          }
        }

        return jso;
      }
    } catch (IntrospectionException e) {
      e.printStackTrace();
      throw new MarshallException(
          "There was an exception while inspecting the class "
              + o.getClass().getName() + ", see stdout");
    } catch (IllegalArgumentException e) {
      e.printStackTrace();
      throw new MarshallException(
          "There was an exception while inspecting the class "
              + o.getClass().getName() + ", see stdout");
    } catch (JSONException e) {
      throw new MarshallException(e.getMessage());
    }
    throw new MarshallException("The specified object ("
        + o.getClass().getName()
        + ") was not an instance of any of the serializable classes");
  }
View Full Code Here

Examples of org.jabsorb.serializer.MarshallException

        jso.put("javaClass", bigInteger.getClass().getName());
      }
      jso.put("value", bigInteger.intValue());
      return jso;
    } catch (Throwable t) {
      throw new MarshallException(t.getMessage());
    }
  }
View Full Code Here

Examples of org.jabsorb.serializer.MarshallException

      addAttributes(state, eo, obj);
      return obj;
    }
    catch (JSONException e) {
      throw new MarshallException("Failed to marshall EO.", e);
    }
  }
View Full Code Here

Examples of org.jabsorb.serializer.MarshallException

        }
      }
      _addCustomAttributes(state, source, destination);
    }
    catch (JSONException e) {
      throw new MarshallException("Failed to marshall EO.", e);
    }
    finally {
      if(useEO) {
        state.pop();
      }
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.