Package ch.inftec.ju.util

Examples of ch.inftec.ju.util.JuRuntimeException


          } else if (clazz == Boolean.class) {
            return (T) new Boolean(obj.toString());
          } else if (clazz == String.class) {
            return (T) obj.toString();
          } else {
            throw new JuRuntimeException("Conversion not supported: " + clazz);
          }
        }
      }
    }
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

                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

        logger.debug("Creating RemoteServiceLocator [host={}:{}, app={} / module={}"
            , new Object[] {this.host, this.port, this.appName, this.moduleName});
       
        return new RemoteServiceLocatorImpl(ctx, this.appName, this.moduleName);
      } catch (Exception ex) {
        throw new JuRuntimeException("Couldn't create ServiceLocator", ex);
      }
    }
View Full Code Here

        @SuppressWarnings("unchecked")
        T obj = (T) this.ctx.lookup(absoluteJndiName);
       
        return obj;
      } catch (Exception ex) {
        throw new JuRuntimeException(ex);
      }
    }
View Full Code Here

   
    private static Context createInitialContext() {
      try {
        return new InitialContext();
      } catch (Exception ex) {
        throw new JuRuntimeException("Couldn't create InitialContext", ex);
      }
    }
View Full Code Here

    @Override
    public <T> T cdi(Class<T> clazz) {
      Set<Bean<?>> beans = this.bm.getBeans(clazz);
      List<T> instances = this.getInstances(beans, clazz);
      if (instances.size() != 1) {
        throw new JuRuntimeException("Expected exactly one result for CDI lookup of " + clazz);
      } else {
        return instances.get(0);
      }
    }
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.