001/*
002 * Copyright 2002-2016 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.beans.factory;
018
019import org.springframework.beans.FatalBeanException;
020
021/**
022 * Exception that a bean implementation is suggested to throw if its own
023 * factory-aware initialization code fails. BeansExceptions thrown by
024 * bean factory methods themselves should simply be propagated as-is.
025 *
026 * <p>Note that {@code afterPropertiesSet()} or a custom "init-method"
027 * can throw any exception.
028 *
029 * @author Juergen Hoeller
030 * @since 13.11.2003
031 * @see BeanFactoryAware#setBeanFactory
032 * @see InitializingBean#afterPropertiesSet
033 */
034@SuppressWarnings("serial")
035public class BeanInitializationException extends FatalBeanException {
036
037        /**
038         * Create a new BeanInitializationException with the specified message.
039         * @param msg the detail message
040         */
041        public BeanInitializationException(String msg) {
042                super(msg);
043        }
044
045        /**
046         * Create a new BeanInitializationException with the specified message
047         * and root cause.
048         * @param msg the detail message
049         * @param cause the root cause
050         */
051        public BeanInitializationException(String msg, Throwable cause) {
052                super(msg, cause);
053        }
054
055}