Package ch.inftec.ju.util

Examples of ch.inftec.ju.util.JuRuntimeException


   
    for (int i = 0; i < distinctValues.length; i++) {
      try {
        distinctValuesLong[i] = Long.parseLong(distinctValues[i]);
      } catch (Exception ex) {
        throw new JuRuntimeException("Couldn't convert " + distinctValues[i] + " to Long", ex);
      }
    }
   
    return distinctValuesLong;
  }
View Full Code Here


        schema.newValidator().validate(new DOMSource(doc));
      }

      return doc;
    } catch (Exception ex) {
      throw new JuRuntimeException("Couldn't load XML", ex);
    }
  }
View Full Code Here

      SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
      Schema schema = schemaFactory.newSchema(url);

      return schema;
    } catch (Exception ex) {
      throw new JuRuntimeException("Couldn't load XML schema: " + url, ex);
    }
  }
View Full Code Here

      try (ByteArrayOutputStream os = new ByteArrayOutputStream();) {
        transformer.transform(new DOMSource(document), new StreamResult(os));
        return new String(os.toByteArray(), "UTF-8");
      }     
    } catch (Exception ex) {
      throw new JuRuntimeException("Couldn't convert XML to String", ex);
    }
  }
View Full Code Here

          } else if (clazz == String.class) {
            return (T) obj.toString();
          } else if (clazz == Date.class) {
            return (T) JuStringUtils.parseIso8601Date(obj.toString());
          } else {
            throw new JuRuntimeException("Conversion not supported: " + clazz);
          }
        }
      }
    }
View Full Code Here

                String xmlString = writer.toString();

                logger.debug("Marshalling done");
                return xmlString;
            } catch (Exception ex) {
              throw new JuRuntimeException("Couldn't marshal object %s (using Schema: %s)", ex, o, null);//this.schema), ex);
            }
      }
View Full Code Here

                }
               
                return obj;
            } catch (Exception ex) {
              logger.debug("Marshalling of String failed: " + xmlString);
                throw new JuRuntimeException("Couldn't unmarshal XML String (XML is dumped as debug log)", ex);
            }
        }
View Full Code Here

            }
           
            try {
              return cache.get(contextPath);
            } catch (ExecutionException ex) {
              throw new JuRuntimeException("Couldn't load new JAXBContext for %s", ex, contextPath);
            }
          } else {
            return createContext(contextPath);
          }
        }
View Full Code Here

      if (namespacePrefix != null) {
        xb.addNamespace(namespacePrefix, namespaceUri);
      }
      return xb;
    } catch (Exception ex) {
      throw new JuRuntimeException("Couldn't initialize XML Document");
    }
  }
View Full Code Here

      this.server = server;
     
      try {
        this.objectName = new ObjectName(objectName);
      } catch (Exception ex) {
        throw new JuRuntimeException("Couldn't create ObjectName for %s", ex, objectName);
      }
    }
View Full Code Here

TOP

Related Classes of ch.inftec.ju.util.JuRuntimeException

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.