if(null != existsBeanDefinition){ throw new BeanDefinitionException("Found duplicated bean id '" + id + "' in resource : " + bd.getSource() + ", " + existsBeanDefinition.getSource()); throw new BeanDefinitionException("Found duplicated bean namespace '" + bd.getNamespace() + "' and name '" + bd.getName() + "' in resource : " + bd.getSource() + ", " + existsBeanDefinition.getSource());
" for type '" + beanType.getName() + "' with exists " + (proxy ? "proxy" : "bean") + " in " + existsBeanDefinition.getSource()+", please use sort-order to defined which bean definition to be use."); log.warn("Now use is "+bd); throw new BeanDefinitionException("Found duplicated primary " + (proxy ? "proxy " : "bean ") + definition + " for type '" + beanType.getName() + "' with exists " + (proxy ? "proxy" : "bean") + " in " + existsBeanDefinition.getSource()); " for type '" + beanType.getName() + "' with exists " + (proxy ? "proxy" : "bean") + " in " + existsBeanDefinition.getSource()+", please use sort-order to defined which bean definition to be use."); log.warn("Now use is "+bd); }else{ throw new BeanDefinitionException("Found duplicated type proxy " + definition + " for type '" + beanType.getName() + "' with exists proxy in " + d.getSource()); }else{ throw new BeanDefinitionException("duplicate bean definition in xml:" +bd.getSource() + " and annotation:"+bdf.getSource() +", if you want to override annotation bean definition, please " +"use override-annotation=\"true\" in xml definition.");
protected void readBeanTypeDef(BeanContainer container, XmlReader reader, LoaderContext context, BeanDefinitionBase bean) { TypeDefinitionBase def = new TypeDefinitionBase(); String typeClassName = reader.getRequiredAttribute(TYPE_ATTRIBUTE); Class<?> typeClass = tryForName(typeClassName); if (null == typeClass) { throw new BeanDefinitionException("Class '" + typeClassName + "' not found, check source : " + bean.getSource()); } if (!typeClass.isAssignableFrom(bean.getBeanClass())) { throw new BeanDefinitionException("bean's type '" + typeClassName + "' must be assignable from bean's class '" + bean.getBeanClass().getName() + "', source : " + reader.getSource()); } def.setType(typeClass); def.setName(reader.getAttribute(NAME_ATTRIBUTE)); def.setPrimary(reader.getBooleanAttribute(PRIMARY_ATTRIBUTE, false)); def.setOverride(reader.getBooleanAttribute(OVERRIDE_ATTRIBUTE, context.defaultOverride)); bean.addAdditionalTypeDef(def); }
throw new BeanDefinitionException("the alias name '" + aliasDefinition.getAlias() + "' aleady used by another bean, please check the xmls : " + aliasDefinition.getSource() + "," + bean.getSource()); throw new BeanDefinitionException("The alias name '" + aliasDefinition.getAlias() + "' aleady used by another bean, please check the xmls : " + aliasDefinition.getSource() + "," + bean.getSource());
protected void readProperty(BeanContainer container, XmlReader reader, LoaderContext context, BeanDefinitionBase bean) { if(!testIfAttributes(container, reader)) { reader.nextToEndElement(); return; } PropertyDefinition prop = new PropertyDefinition(); prop.setName(reader.getRequiredAttribute(NAME_ATTRIBUTE)); prop.setDefaultValue(reader.getAttribute(DEFAULT_VALUE_ATTRIBUTE)); prop.setValueDefinition(readValue(container, reader, context, PROPERTY_ELEMENT)); prop.setProperty(bean.getBeanClassType().getProperty(prop.getName())); if (null == prop.getProperty()) { throw new BeanDefinitionException("property '" + prop.getName() + "' not found in bean class '" + bean.getBeanClass().getName() + ", source : " + reader.getSource()); } if (null == prop.getValueDefinition()) { throw new BeanDefinitionException("property '" + prop.getName() + "' must define a value, check source : " + bean.getSource()); } bean.addProperty(prop); }