1 16 17 package org.springframework.beans.factory; 18 19 import org.springframework.beans.FatalBeanException; 20 21 27 public class BeanCreationException extends FatalBeanException { 28 29 private String beanName; 30 31 private String resourceDescription; 32 33 34 38 public BeanCreationException(String msg) { 39 super(msg); 40 } 41 42 47 public BeanCreationException(String msg, Throwable cause) { 48 super(msg, cause); 49 } 50 51 56 public BeanCreationException(String beanName, String msg) { 57 this(beanName, msg, (Throwable ) null); 58 } 59 60 66 public BeanCreationException(String beanName, String msg, Throwable cause) { 67 super("Error creating bean with name '" + beanName + "': " + msg, cause); 68 this.beanName = beanName; 69 } 70 71 78 public BeanCreationException(String resourceDescription, String beanName, String msg) { 79 this(resourceDescription, beanName, msg, null); 80 } 81 82 90 public BeanCreationException(String resourceDescription, String beanName, String msg, Throwable cause) { 91 super("Error creating bean with name '" + beanName + "'" + 92 (resourceDescription != null ? " defined in " + resourceDescription : "") + 93 ": " + msg, cause); 94 this.resourceDescription = resourceDescription; 95 this.beanName = beanName; 96 } 97 98 99 102 public String getBeanName() { 103 return this.beanName; 104 } 105 106 110 public String getResourceDescription() { 111 return this.resourceDescription; 112 } 113 114 } 115 | Popular Tags |