congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HstComponentException
Code IndexAdd Tabnine to your IDE (free)

How to use
HstComponentException
in
org.hippoecm.hst.core.component

Best Java code snippets using org.hippoecm.hst.core.component.HstComponentException (Showing top 20 results out of 315)

origin: org.onehippo.cms7.hst.components/hst-core

@SuppressWarnings("unchecked")
public <T> T getObjectInstance(HstContainerConfig requestContainerConfig, String className) throws HstComponentException {
  try {
    Class<T> clazz = (Class<T>) Class.forName(className);
    return (T) clazz.newInstance();
  } catch (ClassNotFoundException e) {
    throw new HstComponentException("Cannot find the class of " + className);
  } catch (InstantiationException e) {
    throw new HstComponentException("Cannot instantiate the class of " + className);
  } catch (IllegalAccessException e) {
    throw new HstComponentException("Illegal access to the class of " + className);
  }
}

origin: org.onehippo.ecm.hst/hst-commons

/**
 * Returns all exceptions which have the <CODE>causeType</CODE> and generated by a component of <CODE>componentInfo</CODE>. 
 * 
 * @param pageErrors
 * @param causeType
 * @return
 */
public static Collection<HstComponentException> getExceptionsByCauseType(PageErrors pageErrors, HstComponentInfo componentInfo, Class<? extends Throwable> causeType) {
  List<HstComponentException> exceptions = null;
  
  for (HstComponentException exception : pageErrors.getComponentExceptions(componentInfo)) {
    Throwable cause = exception.getCause();
    
    if (cause != null && causeType.isAssignableFrom(cause.getClass())) {
      if (exceptions == null) {
        exceptions = new ArrayList<HstComponentException>();
      }
      
      exceptions.add(exception);
    }
  }
  
  if (exceptions == null) {
    exceptions = Collections.emptyList();
  }
  
  return exceptions;
}

origin: org.onehippo.ecm.hst.components/hst-core

    log.warn("Component exception caught: " + e.toString(), e);
  } else if (log.isWarnEnabled()) {
    log.warn("Component exception caught: {}", e.toString());
    throw new HstComponentException(e);
  window.addComponentExcpetion(new HstComponentException(e));
window.addComponentExcpetion(new HstComponentException("The component is not available."));
origin: org.onehippo.ecm.hst.components/hst-core

protected void logWarningsForEachComponentExceptions(PageErrors pageErrors) {
  for (HstComponentInfo componentInfo : pageErrors.getComponentInfos()) {
    for (HstComponentException componentException : pageErrors.getComponentExceptions(componentInfo)) {
      if (log.isDebugEnabled()) {
        log.warn("Component exception found on " + componentInfo.getComponentClassName(), componentException);
      } else if (log.isWarnEnabled()) {
        log.warn("Component exception found on {}. ", componentInfo.getComponentClassName(), componentException.toString());
      }
    }
  }
}

origin: org.onehippo.cms7/hippo-essentials-components-hst

protected void handleInvalidScope(final HstRequest request, final HstResponse response) {
  // TODO determine what to do with invalid scope
  response.setStatus(HttpServletResponse.SC_NOT_FOUND);
  if (log.isDebugEnabled()) {
    throw new HstComponentException("EssentialsListComponent needs a valid scope to display documents");
  }
}
origin: org.onehippo.ecm.hst.components/hst-core

    log.warn("Component exception caught on window " + window.getName() + " with component " + component.getClass().getName() + ": " + e.toString(), e);
  } else if (log.isWarnEnabled()) {
    log.warn("Component exception caught on window " + window.getName() + " with component " + component.getClass().getName() + ": {}", e.toString());
    throw new HstComponentException(e);
  window.addComponentExcpetion(new HstComponentException(e));
window.addComponentExcpetion(new HstComponentException("The component is not available."));
origin: org.onehippo.ecm.hst/hst-commons

/**
 * Returns all exceptions which have the <CODE>causeType</CODE>.
 * 
 * @param pageErrors
 * @param causeType
 * @return
 */
public static Collection<HstComponentException> getExceptionsByCauseType(PageErrors pageErrors, Class<? extends Throwable> causeType) {
  List<HstComponentException> exceptions = null;
  
  for (HstComponentException exception : pageErrors.getAllComponentExceptions()) {
    Throwable cause = exception.getCause();
    
    if (cause != null && causeType.isAssignableFrom(cause.getClass())) {
      if (exceptions == null) {
        exceptions = new ArrayList<HstComponentException>();
      }
      
      exceptions.add(exception);
    }
  }
  
  if (exceptions == null) {
    exceptions = Collections.emptyList();
  }
  
  return exceptions;
}

origin: org.onehippo.cms7.hst/hst-client

protected BeanFactory getContextBeanFactory(final ServletContext servletContext, final String [] contextNames) {
  BeanFactory beanFactory = null;
  String contextName = null;
  try {
    int beginIndex;
    if (contextNames.length > 0 && StringUtils.startsWith(contextNames[0], FrameworkServlet.SERVLET_CONTEXT_PREFIX)) {
      beanFactory = WebApplicationContextUtils.getWebApplicationContext(servletContext, contextNames[0]);
      beginIndex = 1;
    } else {
      beanFactory = WebApplicationContextUtils.getWebApplicationContext(servletContext);
      beginIndex = 0;
    }
    if (contextNames != null) {
      for (int i = beginIndex; i < contextNames.length; i++) {
        contextName = contextNames[i];
        beanFactory = (BeanFactory) beanFactory.getBean(contextName);
      }
    }
  } catch (NoSuchBeanDefinitionException e) {
    throw new HstComponentException("There's no beanFactory definition with the specified name: " + contextName, e);
  } catch (BeansException e) {
    throw new HstComponentException("The beanFactory cannot be obtained: " + contextName, e);
  } catch (ClassCastException e) {
    throw new HstComponentException("The bean is not an instance of beanFactory: " + contextName, e);
  } catch (Exception e) {
    throw new HstComponentException("The beanFactory cannot be obtained: " + contextName, e);
  }
  return beanFactory;
}
origin: org.onehippo.ecm.hst.components/hst-core

    log.warn("Component exception caught on window " + window.getName() + " with component " + component.getClass().getName() + ": " + e.toString(), e);
  } else if (log.isWarnEnabled()) {
    log.warn("Component exception caught on window " + window.getName() + " with component " + component.getClass().getName() + ": {}", e.toString());
    throw new HstComponentException(e);
  window.addComponentExcpetion(new HstComponentException(e));
window.addComponentExcpetion(new HstComponentException("The component is not available."));
origin: org.onehippo.ecm.hst/hst-commons

Throwable cause = exception.getCause();
origin: org.onehippo.ecm.hst.components/hst-core

@SuppressWarnings("unchecked")
public <T> T getObjectInstance(HstContainerConfig requestContainerConfig, String className) throws HstComponentException {
  T object = null;
  
  ClassLoader containerClassloader = requestContainerConfig.getContextClassLoader();
  ClassLoader currentClassloader = Thread.currentThread().getContextClassLoader();
  try {
    if (containerClassloader != currentClassloader) {
      Thread.currentThread().setContextClassLoader(containerClassloader);
    }
    
    Class<T> clazz = (Class<T>) containerClassloader.loadClass(className);
    object = (T) clazz.newInstance();
  } catch (ClassNotFoundException e) {
    throw new HstComponentException("Cannot find the class of " + className);
  } catch (InstantiationException e) {
    throw new HstComponentException("Cannot instantiate the class of " + className);
  } catch (IllegalAccessException e) {
    throw new HstComponentException("Illegal access to the class of " + className);
  } finally {
    if (containerClassloader != currentClassloader) {
      Thread.currentThread().setContextClassLoader(currentClassloader);
    }                
  }
  
  return object;
}

origin: org.onehippo.ecm.hst.components/hst-core

  log.warn("Component exception caught on window " + window.getName() + " with component " + component.getClass().getName() + ": " + e.toString(), e);
} else if (log.isWarnEnabled()) {
  log.warn("Component exception caught on window " + window.getName() + " with component " + component.getClass().getName() + ": {}", e.toString());
  throw new HstComponentException(e);
window.addComponentExcpetion(new HstComponentException(e));
origin: org.onehippo.cms7.hst/hst-client

protected void doDispatch(String dispatchPath, HstRequest request, HstResponse response) throws HstComponentException {
  if (dispatchPath != null) {
    try {
      servletContext.getRequestDispatcher(dispatchPath).include(request, response);
    } catch (ServletException e) {
      throw new HstComponentException(e);
    } catch (IOException e) {
      throw new HstComponentException(e);
    }
  } else {
    if (log.isDebugEnabled()) {
      log.debug("The dispatch path is null. The lifecycle phase is {} and the dispatch lifecycle phase is {}", 
          request.getLifecyclePhase(), 
          request.getAttribute(LIFECYCLE_PHASE_ATTRIBUTE));
    }
  }
}
origin: org.onehippo.ecm.hst.components/hst-core

  log.warn("Component exception caught on window " + window.getName() + " with component " + component.getClass().getName() + ": " + e.toString(), e);
} else if (log.isWarnEnabled()) {
  log.warn("Component exception caught on window " + window.getName() + " with component " + component.getClass().getName() + ": {}", e.toString());
  throw new HstComponentException(e);
window.addComponentExcpetion(new HstComponentException(e));
origin: org.onehippo.ecm.hst/hst-client

public ObjectBeanManager getObjectBeanManager(HstRequest request) {
  try {
    HstRequestContext requestContext = request.getRequestContext();
    return new ObjectBeanManagerImpl(requestContext.getSession(), this.objectConverter);
  } catch (UnsupportedRepositoryOperationException e) {
    throw new HstComponentException(e);
  } catch (RepositoryException e) {
    throw new HstComponentException(e);
  }
}

origin: org.onehippo.ecm.hst/hst-client

protected void doDispatch(String dispatchPath, HstRequest request, HstResponse response) throws HstComponentException {
  if (dispatchPath != null) {
    try {
      getServletContext().getRequestDispatcher(dispatchPath).include(request, response);
    } catch (ServletException e) {
      throw new HstComponentException(e);
    } catch (IOException e) {
      throw new HstComponentException(e);
    }
  } else {
    if (log.isDebugEnabled()) {
      log.debug("The dispatch path is null. The lifecycle phase is {} and the dispatch lifecycle phase is {}", 
          request.getLifecyclePhase(), 
          request.getAttribute(LIFECYCLE_PHASE_ATTRIBUTE));
    }
  }
}

origin: org.onehippo.ecm.hst.components/hst-core

public String toString() {
  HstContainerURL containerURL = this.urlProvider.createURL(this.baseContainerURL, this);
  containerURL.setResourceId(getResourceID());
  
  try {
    return this.urlProvider.toURLString(containerURL, requestContext);
  } catch (UnsupportedEncodingException e) {
    throw new HstComponentException(e);
  } catch (ContainerException e) {
    throw new HstComponentException(e);
  }
}
origin: org.onehippo.cms7.hst.components/hst-core

public String toString() {
  HstContainerURL containerURL = this.urlProvider.createURL(this.baseContainerURL, this);
  containerURL.setResourceId(getResourceID());
  
  try {
    return this.urlProvider.toURLString(containerURL, requestContext, explicitContextPath);
  } catch (UnsupportedEncodingException e) {
    throw new HstComponentException(e);
  } catch (ContainerException e) {
    throw new HstComponentException(e);
  }
}
origin: org.onehippo.ecm.hst/hst-client

throw new HstComponentException("The name of delegated spring bean is null.");
  throw new HstComponentException("There's no beanFactory definition with the specified name: " + contextName, e);
} catch (BeansException e) {
  throw new HstComponentException("The beanFactory cannot be obtained: " + contextName, e);
} catch (ClassCastException e) {
  throw new HstComponentException("The bean is not an instance of beanFactory: " + contextName, e);
  throw new HstComponentException("Cannot find the root web application context or client component manager.");
} else if (beanFactory != null && componentManager == null) {
  throw new HstComponentException("Cannot find delegated spring HstComponent bean from the web application context: " + beanName);
} else if (beanFactory == null && componentManager != null) {
  throw new HstComponentException("Cannot find delegated spring HstComponent bean from the client component manager: " + beanName);
} else {
  throw new HstComponentException("Cannot find delegated spring HstComponent bean from either the web application context or the client component manager: " + beanName);
origin: org.onehippo.ecm.hst.components/hst-core

public Session getSession() throws LoginException, RepositoryException {
  if (this.session == null) {
    this.session = this.repository.login(contextCredentialsProvider.getDefaultCredentials(this));
  } else if (!this.session.isLive()) {
    throw new HstComponentException("Invalid session.");
  }
  
  return this.session;
}

org.hippoecm.hst.core.componentHstComponentException

Javadoc

The HstComponentException class defines a general exception that a HstComponent can throw when it is unable to perform its operation successfully.

Most used methods

  • <init>
    Constructs a new HstComponent exception with the nested exception.
  • getCause
  • toString

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JComboBox (javax.swing)
  • JFileChooser (javax.swing)
  • JPanel (javax.swing)
  • JTextField (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now