Package org.springframework.beans

Examples of org.springframework.beans.FatalBeanException


            } else {
                try {
                    Object obj = ClassLoaderUtils.loadClass(val, getClass()).newInstance();
                    bean.addConstructorArg(obj);
                } catch (Exception e) {
                    throw new FatalBeanException("Could not load class: " + val, e);
                }
            }
        }
    }
View Full Code Here


            } else {
                try {
                    Object obj = ClassLoaderUtils.loadClass(val, getClass()).newInstance();
                    bean.addConstructorArg(obj);
                } catch (Exception e) {
                    throw new FatalBeanException("Could not load class: " + val, e);
                }
            }
        }
    }
View Full Code Here

                creatorConfig.addPropertyValue("includes", includes);
                BeanDefinitionHolder aux = new BeanDefinitionHolder(creatorConfig.getBeanDefinition(), creatorConfigName);
                BeanDefinitionReaderUtils.registerBeanDefinition(aux, beanDefinitionRegistry);
                lookupCreators(beanDefinitionRegistry).put(javascript, new RuntimeBeanReference(creatorConfigName));
            } catch (Exception ex) {
                throw new FatalBeanException("Unable to create DWR bean creator for '" + beanDefinitionHolder.getBeanName() + "'. ", ex);
            }
        }
    }
View Full Code Here

        {
            this.beanClass = beanFactory.getType(beanId);
        }
        else
        {
            throw new FatalBeanException("You should either set the bean property directly or set the beanId property");
        }

        // make sure to handle cglib proxies correctly
        if (AopUtils.isCglibProxyClass(this.beanClass))
        {
View Full Code Here

        try
        {
            String beanClassName = resolveBeanClassname(bean.getBeanDefinition(), parserContext.getRegistry());
            if (beanClassName == null)
            {
                throw new FatalBeanException("Unabled to find type for beanName '" + name + "'. " + "Check your bean has a correctly configured parent or provide a class for " + " the bean definition");
            }
            beanCreator.addPropertyValue("beanClass", ClassUtils.forName(beanClassName, getClass().getClassLoader()));
        }
        catch (ClassNotFoundException e)
        {
            throw new FatalBeanException("Unable to create DWR bean creator for '" + name + "'.", e);
        }


        if (name.startsWith("scopedTarget."))
        {
View Full Code Here

                BeanDefinition parentDefinition = findParentDefinition(parentName, registry);
                beanClassName = parentDefinition.getBeanClassName();
                definition = parentDefinition;
            } catch (Exception e)
            {
                throw new FatalBeanException("No parent bean could be found for " + definition, e);
            }
        }
        return beanClassName;
    }
View Full Code Here

                try {
                    DocumentBuilder builder = new SourceTransformer().createDocumentBuilder();
                    Document doc = builder.parse(url.toString());
                    classLoader = getClassLoader(applicationContext, reader, doc);
                } catch (Exception e) {
                    throw new FatalBeanException("Unable to load classpath.xml file", e);
                }
            } else {
                try {
                    URL[] urls = getDefaultLocations();
                    ClassLoader parentLoader = getParentClassLoader(applicationContext);
                    classLoader = new JarFileClassLoader(applicationContext.getDisplayName(), urls, parentLoader);
                    // assign the class loader to the xml reader and the
                    // application context
                } catch (Exception e) {
                    throw new FatalBeanException("Unable to create default classloader for SU", e);
                }
            }
        } else {
            classLoader = getClassLoader(applicationContext, reader, document);
        }
View Full Code Here

                    urls[i + 1] = jars[i].toURL();
                }
            }
            return urls;
        } catch (MalformedURLException e) {
            throw new FatalBeanException("Unable to get default classpath locations", e);
        }
    }
View Full Code Here

        ClassLoader classLoader;
        NodeList classpathElements = document.getDocumentElement().getElementsByTagName("classpath");
        if (classpathElements.getLength() < 1) {
            classLoader = getParentClassLoader(applicationContext);
        } else if (classpathElements.getLength() > 1) {
            throw new FatalBeanException("Expected only classpath element but found " + classpathElements.getLength());
        } else {
            Element classpathElement = (Element) classpathElements.item(0);
           
            String fileDelegation = classpathElement.getAttribute("file");
            if (fileDelegation != null) {
                URL url = getResource(fileDelegation);
                if (url != null) {
                    try {
                        DocumentBuilder builder = new SourceTransformer().createDocumentBuilder();
                        Document doc = builder.parse(url.toString());
                        classLoader = getClassLoader(applicationContext, reader, doc);
                        return classLoader;
                    } catch (Exception e) {
                        throw new FatalBeanException("Unable to load " + url + " file.", e);
                    }
                }
            }
           
            // Delegation mode
View Full Code Here

            public void doWith(Method method) {
                if (method.getName().equals(methodName)) {
                    try {
                        injectMethod(bean, method);
                    } catch (Throwable e) {
                        throw new FatalBeanException("Problem injecting logger.  " + e.getMessage(), e);
                    }
                }
            }
        });   
    }
View Full Code Here

TOP

Related Classes of org.springframework.beans.FatalBeanException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.