package org.theonefx.wcframework.ioc.exception; import org.theonefx.wcframework.core.exception.FatalBeanException; import org.theonefx.wcframework.ioc.RootBeanDefinition; public class CannotLoadBeanClassException extends FatalBeanException { private static final long serialVersionUID = 4706570025557553717L; private String resourceDescription; private String beanName; private String beanClassName; /** * Create a new CannotLoadBeanClassException. * @param resourceDescription description of the resource * that the bean definition came from * @param beanName the name of the bean requested * @param beanClassName the name of the bean class * @param cause the root cause */ public CannotLoadBeanClassException(String beanName, RootBeanDefinition mbd, Exception cause) { super("Cannot find class [" + mbd.getBeanClassName() + "] for bean with name '" + beanName + "' defined in " + cause); this.beanName = beanName; } /** * Create a new CannotLoadBeanClassException. * @param resourceDescription description of the resource * that the bean definition came from * @param beanName the name of the bean requested * @param beanClassName the name of the bean class * @param cause the root cause */ public CannotLoadBeanClassException(String beanName, String beanClassName, LinkageError cause) { super("Error loading class [" + beanClassName + "] for bean with name '" + beanName + "' defined in " + ": problem with class file or dependent class", cause); this.beanName = beanName; this.beanClassName = beanClassName; } /** * Return the description of the resource that the bean * definition came from. */ public String getResourceDescription() { return this.resourceDescription; } /** * Return the name of the bean requested. */ public String getBeanName() { return this.beanName; } /** * Return the name of the class we were trying to load. */ public String getBeanClassName() { return this.beanClassName; } }