Code example for ApplicationContextException

0
			initApplicationContext(context);
		} 
		else { 
			// Ignore reinitialization if same context passed in. 
			if (this.applicationContext != context) {
				throw new ApplicationContextException(
						"Cannot reinitialize with different application context: current one is [" + 
						this.applicationContext + "], passed-in one is [" + context + "]");
			} 
		} 
	} 
 
	/** 
	 * Determine whether this application object needs to run in an ApplicationContext. 
	 * <p>Default is "false". Can be overridden to enforce running in a context 
	 * (i.e. to throw IllegalStateException on accessors if outside a context). 
	 * @see #getApplicationContext 
	 * @see #getMessageSourceAccessor 
	 */ 
	protected boolean isContextRequired() {