/** * @param unused */ public void setUpgradeSessionFactoryBeanName(final String unused) { throw new ConfigException(getClass() + ": property [upgradeSessionFactoryBeanName] is obsolete, " + "use [jdbcSessionFactoryBeanName] instead and " + "optionnaly [jndiSessionFactoryBeanName]"); }
/** * @param unused */ public void setSessionFactoryBeanName(final String unused) { throw new ConfigException(getClass() + ": property [sessionFactoryBeanName] is obsolete, " + "use [jdbcSessionFactoryBeanName] instead and " + "optionnaly [jndiSessionFactoryBeanName]"); }
@Override public void afterPropertiesSet() throws Exception { if (jdbcSessionFactoryBeanName == null && jndiSessionFactoryBeanName == null) { throw new ConfigException("properties [jdbcSessionFactoryBeanName] " + "and [jndiSessionFactoryBeanName] of class [" + getClass().getName() + "] can not be both null"); } }
@Override public void setTransactionnal(final boolean transactionnal) { throw new ConfigException( "property [" + transactionnal + "] is always true for class [" + getClass().getName() + "]"); }
@Override public void initDao() throws Exception { if (jdbcHibernateTemplateBeanName == null && useJdbc ) { throw new ConfigException("property [jdbcHibernateTemplateBeanName] of " + getClass().getName() + "] can not be null when property [useJdbc] is true"); } if (jndiHibernateTemplateBeanName == null && useJndi ) { throw new ConfigException("property [jndiHibernateTemplateBeanName] of " + getClass().getName() + "] can not be null when property [useJndi] is true"); } if (!useJdbc && !useJndi) { throw new ConfigException("properties [useJdbc] and [useJndi] of class [" + getClass().getName() + "] can not be both false"); } }
/** * Add an exception view. * @param className * @param exceptionView */ @SuppressWarnings("unchecked") private void addExceptionView(final String className, final String exceptionView) { try { Class<?> clazz = Class.forName(className); if (!(Throwable.class.isAssignableFrom(clazz))) { throw new ConfigException("class [" + className + "] is not a subclass of [" + Throwable.class + "]"); } Class <? extends Throwable> exceptionClazz = (Class <? extends Throwable>) clazz; this.exceptionViews.put(exceptionClazz, exceptionView); } catch (ClassNotFoundException e) { throw new ConfigException(e); } }
/** * Add a 'no email' exception. * @param className */ @SuppressWarnings("unchecked") private void addNoEmailException(final String className) { try { Class<?> clazz = Class.forName(className); if (!(Exception.class.isAssignableFrom(clazz))) { throw new ConfigException("class [" + className + "] is not a subclass of [" + Exception.class + "]"); } Class<? extends Throwable> exceptionClazz = (Class<? extends Throwable>) clazz; this.noEmailExceptions.add(exceptionClazz); } catch (ClassNotFoundException e) { throw new ConfigException(e); } }
@Override public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); if (jdbcUpgradeSessionFactoryBeanName == null && jndiUpgradeSessionFactoryBeanName == null) { throw new ConfigException("properties [jdbcUpgradeSessionFactoryBeanName] " + "and [jndiUpgradeSessionFactoryBeanName] of class [" + getClass().getName() + "] can not be both null"); } Assert.hasText(createSessionFactoryBeanName, "property [createSessionFactoryBeanName] of class [" + getClass().getName() + "] can not be null"); }
/** * @param t * @param to * @param interceipt * @return the cache key that corresponds to a user and an exception. */ private String getCacheKey( final Throwable t, final InternetAddress to, final boolean interceipt) { try { MessageDigest md = MessageDigest.getInstance("MD5"); md.reset(); md.update(ExceptionUtils.getPrintableStackTrace(t).getBytes()); return to.toString() + " - " + new String(md.digest()) + interceipt; } catch (NoSuchAlgorithmException e2) { throw new ConfigException(e2); } }
@Override public void afterPropertiesSet() { super.afterPropertiesSet(); if (!exceptionViews.containsKey(Exception.class)) { setExceptionView(DEFAULT_EXCEPTION_VIEW); } if (!StringUtils.hasText(logLevel)) { logLevel = ERROR; } if (!ERROR.equalsIgnoreCase(logLevel) && !WARN.equalsIgnoreCase(logLevel) && !INFO.equalsIgnoreCase(logLevel) && !TRACE.equalsIgnoreCase(logLevel) && !DEBUG.equalsIgnoreCase(logLevel)) { throw new ConfigException("invalid value for property [logLevel], " + "accepted values are ERROR, WARN, INFO, TRACE and DEBUG"); } }
/** * return all list UrlPatternDescriptor. */ private List<UrlPatternDescriptor> getUrlDescriptor() { //ADD Action Map<String, UrlPatternDescriptor> treatments = BeanUtils.getBeansOfClass(UrlPatternDescriptor.class); List<UrlPatternDescriptor> urlP = new ArrayList<UrlPatternDescriptor>(); for (String name : treatments.keySet()) { if (logger.isDebugEnabled()) { logger.debug("get to roles bean [" + name + "]..."); } UrlPatternDescriptor bean = treatments.get(name); if (bean == null) { throw new ConfigException("bean [" + name + "] is null, " + "application doesn't init action."); } urlP.add(bean); } return urlP; }
/** * return all list UrlPatternDescriptor. */ private List<UrlPatternDescriptor> getUrlDescriptor() { //ADD Action Map<String, UrlPatternDescriptor> treatments = BeanUtils.getBeansOfClass(UrlPatternDescriptor.class); List<UrlPatternDescriptor> urlP = new ArrayList<UrlPatternDescriptor>(); for (String name : treatments.keySet()) { if (logger.isDebugEnabled()) { logger.debug("get to roles bean [" + name + "]..."); } UrlPatternDescriptor bean = treatments.get(name); if (bean == null) { throw new ConfigException("bean [" + name + "] is null, " + "application doesn't init action."); } urlP.add(bean); } return urlP; }
method = getClass().getMethod(methodName, methodArgs); } catch (SecurityException e) { throw new ConfigException( "access to the information of class " + getClass() + " was denied", e); } catch (NoSuchMethodException e) { throw new ConfigException( "could no find method " + getClass() + "." + methodName + "()", e); throw new ConfigException( "could no invoke method " + getClass() + "." + methodName + "()", invocationException);
if (AuthEnum.cas.equals(authType)) { if (getCasLoginUrl() == null) { throw new ConfigException("casLoginUrl is null"); throw new ConfigException("servletCasLoginUrl is null"); throw new ConfigException("servletShibbolethLoginUrl is null"); throw new ConfigException("servletGuestUrl is null");
} catch (NoSuchMethodException e) { log.error(e); throw new ConfigException("the method name " + methodName + "does not exist for the class "
/** * JSF callback. * @return a String. */ public String restart() { Map<String, Resettable> resettables = BeanUtils.getBeansOfClass(Resettable.class); for (String name : resettables.keySet()) { if (logger.isDebugEnabled()) { logger.debug("trying to reset bean [" + name + "]..."); } Resettable bean = resettables.get(name); if (bean == null) { throw new ConfigException("bean [" + name + "] is null, " + "application can not be restarted."); } bean.reset(); if (logger.isDebugEnabled()) { logger.debug("bean [" + name + "] was reset."); } } ExceptionUtils.unmarkExceptionCaught(); return "applicationRestarted"; }
navigation.handleNavigation(context, "", (String) navRules); } else { throw new ConfigException("une chaine de caractere pour la redirection " + "doit être définis" + " dans la propiété viewId ou "
navigation.handleNavigation(context, "", (String) navRules); } else { throw new ConfigException("une chaine de caractere pour la redirection " + "doit être définis" + " dans la propiété viewId ou "