Spring Framework BeanInitializationException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework BeanInitializationException class.

This code example shows how to use the following methods:
		// Let concrete implementations initialize themselves. 
		try { 
			initDao(); 
		} 
		catch (Exception ex) {
			throw new BeanInitializationException("Initialization of DAO failed", ex);
		} 
	} 
 
	/** 
	 * Abstract subclasses must override this to check their configuration. 
	 * <p>Implementors should be marked as {@code final} if concrete subclasses 
	 * are not supposed to override this template method themselves. 
	 * @throws IllegalArgumentException in case of illegal configuration 
	 */ 
	protected abstract void checkDaoConfig() throws IllegalArgumentException;
 
	/** 
	 * Concrete subclasses can override this for custom initialization behavior. 
	 * Gets called after population of this instance's bean properties. 
6
CodeRank
This code example shows how to use the following methods:
		} 
		try { 
			initGateway(); 
		} 
		catch (Exception ex) {
			throw new BeanInitializationException("Initialization of JMS gateway failed: " + ex.getMessage(), ex);
		} 
	} 
 
	/** 
	 * Subclasses can override this for custom initialization behavior. 
	 * Gets called after population of this instance's bean properties. 
	 * @throws java.lang.Exception if initialization fails 
	 */ 
	protected void initGateway() throws Exception {
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:
		super.setBeanFactory(beanFactory); 
		try { 
			createPool(); 
		} 
		catch (Throwable ex) { 
			throw new BeanInitializationException("Could not create instance pool for TargetSource", ex); 
		} 
	} 
 
 
	/** 
	 * Create the pool. 
	 * @throws Exception to avoid placing constraints on pooling APIs 
	 */ 
	protected abstract void createPool() throws Exception; 
 
	/** 
	 * Acquire an object from the pool. 
	 * @return an object from the pool 
	 * @throws Exception we may need to deal with checked exceptions from pool 
5
CodeRank
This code example shows how to use the following methods:
                sources.addLast(localPropertySource);
 
                propertyResolver = new PropertySourcesPropertyResolver(sources);
 
            } catch (IOException e) {
                throw new BeanInitializationException("Could not load properties", e);
            } 
        } 
 
        super.postProcessBeanFactory(beanFactory);
    } 
 
 
    /** 
     * Get a property resolver that can read local properties. 
     * 
     * @return a property resolver that can be used to dynamically read the merged property 
     * values configured in applicationContext.xml 
     */ 
    public PropertyResolver getPropertyResolver() {
5
CodeRank
This code example shows how to use the following methods:
		} 
		try { 
			initGateway(); 
		} 
		catch (Exception ex) {
			throw new BeanInitializationException("Initialization of Rabbit gateway failed: " + ex.getMessage(), ex);
		} 
	} 
 
	/** 
	 * Subclasses can override this for custom initialization behavior. 
	 * Gets called after population of this instance's bean properties. 
	 * @throws java.lang.Exception if initialization fails 
	 */ 
	protected void initGateway() throws Exception {
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
	 */ 
	public void afterPropertiesSet() throws Exception { 
		if (this.searcherFactory == null) 
			throw new BeanInitializationException("directory property required"); 
		if (this.analyzer == null) 
			throw new BeanInitializationException("analyzer property required");         
 
		if( this.template==null ) { 
			this.template=new LuceneSearchTemplate(searcherFactory,analyzer); 
		} 
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:
	 * This method constructs a LuceneIndexTemplate basing indexFactory 
	 * and analyzer properties if it is not injected.  
	 */ 
	public void afterPropertiesSet() throws Exception { 
		if( this.template==null && this.indexFactory==null ) { 
			throw new BeanInitializationException("indexFactory property required"); 
		} 
 
		if( this.template==null ) { 
			this.template=new DefaultLuceneIndexTemplate(indexFactory,analyzer); 
		} 
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:
		} 
	} 
 
	public void afterPropertiesSet() throws Exception {
        if (propertiesFileName == null) {
            throw new BeanInitializationException(
                    "Must specify a name of a property file"); 
        } 
	} 
} 
4
CodeRank
This code example shows how to use the following methods:
		} 
		catch (Exception e) {
			if (e instanceof RuntimeException) {
				throw (RuntimeException) e;
			} 
			throw new BeanInitializationException("failed to initialize", e);
		} 
	} 
 
	/** 
	 * Subclasses may implement this for initialization logic. 
	 * @throws Exception Any exception. 
	 */ 
	protected void onInit() throws Exception {
	} 
 
	protected final BeanFactory getBeanFactory() {
		return this.beanFactory;
	} 
 
4
CodeRank
This code example shows how to use the following methods:
 
	public void afterPropertiesSet() throws Exception {
		try { 
			initAction(); 
		} catch (Exception ex) {
			throw new BeanInitializationException("Initialization of this Action failed: " + ex.getMessage(), ex);
		} 
	} 
 
	/** 
	 * Action initializing callback, may be overridden by subclasses to perform custom initialization logic. 
	 * <p> 
	 * Keep in mind that this hook will only be invoked when this action is deployed in a Spring application context 
	 * since it uses the Spring {@link InitializingBean} mechanism to trigger action initialisation. 
	 */ 
	protected void initAction() throws Exception {
	} 
 
	/** 
	 * Returns a "success" result event. 
4
CodeRank