1 16 17 package org.springframework.beans.factory; 18 19 import org.springframework.beans.FatalBeanException; 20 21 28 public class CannotLoadBeanClassException extends FatalBeanException { 29 30 private String resourceDescription; 31 32 private String beanName; 33 34 private String beanClassName; 35 36 37 45 public CannotLoadBeanClassException( 46 String resourceDescription, String beanName, String beanClassName, ClassNotFoundException cause) { 47 48 super("Cannot find class [" + beanClassName + "] for bean with name '" + beanName + 49 "' defined in " + resourceDescription, cause); 50 this.resourceDescription = resourceDescription; 51 this.beanName = beanName; 52 this.beanClassName = beanClassName; 53 } 54 55 63 public CannotLoadBeanClassException( 64 String resourceDescription, String beanName, String beanClassName, LinkageError cause) { 65 66 super("Error loading class [" + beanClassName + "] for bean with name '" + beanName + 67 "' defined in " + resourceDescription + ": problem with class file or dependent class", cause); 68 this.resourceDescription = resourceDescription; 69 this.beanName = beanName; 70 this.beanClassName = beanClassName; 71 } 72 73 74 78 public String getResourceDescription() { 79 return this.resourceDescription; 80 } 81 82 85 public String getBeanName() { 86 return this.beanName; 87 } 88 89 92 public String getBeanClassName() { 93 return this.beanClassName; 94 } 95 96 } 97 | Popular Tags |