Package ch.inftec.ju.util

Examples of ch.inftec.ju.util.JuRuntimeException


      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();

                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

        allInstances.put(contextUuid.get(), new HashMap<Class<?>, CustomScopeInstance<?>>());
      }
      allInstances.get(contextUuid.get()).put(clazz, inst);
      return inst.instance;
    } else {
      throw new JuRuntimeException("No active context");
    }
  }
View Full Code Here

   
    if (createParentDirectories) {
      try {
        Files.createDirectories(localPath.getParent());
      } catch (IOException ex) {
        throw new JuRuntimeException("Couldn't create parent directories", ex);
      }
    }
   
    return localPath;
  }
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 %s, but found %d", clazz, instances.size());
      } 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.