org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name '' defined in ServletContext resource [config.xml]: Unnamed bean definition specifies neither 'class' nor 'parent' - can't generate name

Spring JIRA | Scott Haug | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When setting a property with a factory-bean/factory-method -enabled inner bean, I'm prevented from keeping the bean anonymous. Consider the following: {code} <bean id="foo1" class="example.Foo"> <property name="bar" value="baz"/> </bean> <bean id="foo2" class="example.Foo"> <property name="bar"> <bean factory-bean="foo1" factory-method="getBar"/> </property> </bean> {code} Loading this config results in the following exception: org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name '' defined in ServletContext resource [config.xml]: Unnamed bean definition specifies neither 'class' nor 'parent' - can't generate name at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.generateBeanName(BeanDefinitionReaderUtils.java:102) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:331) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertySubElement(DefaultXmlBeanDefinitionParser.java:660) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertyValue(DefaultXmlBeanDefinitionParser.java:650) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertyElement(DefaultXmlBeanDefinitionParser.java:593) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertyElements(DefaultXmlBeanDefinitionParser.java:492) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:360) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:328) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:265) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:185) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:238) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:155) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:99) ... Giving the inner bean an id is a sufficient workaround for the issue, but obviously it would be nice if this wasn't necessary.

    Spring JIRA | 1 decade ago | Scott Haug
    org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name '' defined in ServletContext resource [config.xml]: Unnamed bean definition specifies neither 'class' nor 'parent' - can't generate name
  2. 0

    When setting a property with a factory-bean/factory-method -enabled inner bean, I'm prevented from keeping the bean anonymous. Consider the following: {code} <bean id="foo1" class="example.Foo"> <property name="bar" value="baz"/> </bean> <bean id="foo2" class="example.Foo"> <property name="bar"> <bean factory-bean="foo1" factory-method="getBar"/> </property> </bean> {code} Loading this config results in the following exception: org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name '' defined in ServletContext resource [config.xml]: Unnamed bean definition specifies neither 'class' nor 'parent' - can't generate name at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.generateBeanName(BeanDefinitionReaderUtils.java:102) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:331) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertySubElement(DefaultXmlBeanDefinitionParser.java:660) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertyValue(DefaultXmlBeanDefinitionParser.java:650) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertyElement(DefaultXmlBeanDefinitionParser.java:593) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertyElements(DefaultXmlBeanDefinitionParser.java:492) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:360) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:328) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:265) at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:185) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:238) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:155) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:99) ... Giving the inner bean an id is a sufficient workaround for the issue, but obviously it would be nice if this wasn't necessary.

    Spring JIRA | 1 decade ago | Scott Haug
    org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name '' defined in ServletContext resource [config.xml]: Unnamed bean definition specifies neither 'class' nor 'parent' - can't generate name
  3. 0

    NoSuchMethodError while deploying Spring based ear file

    Stack Overflow | 2 years ago | Praveen
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/beans.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.data.repository.config.RepositoryConfigurationSource.getAttribute(Ljava/lang/String;)Ljava/lang/String;
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    How does tomcat 6 choose the order to deploy WAR files

    Stack Overflow | 3 years ago | Jay
    org.springframework.beans.factory.BeanDefinitionStoreException: Parser configuration exception parsing XML from ServletContext resource [/WEB-INF/classes/edu/cornell/finsys/webservices.xml]; nested exception is javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [oracle.xml.jaxp.JXDocumentBuilderFactory@10987197] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.
  6. 0

    Weblogic 10.3.3 conflict with HtmlUnit Spring webservice

    Stack Overflow | 5 years ago | TomCo
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring-ws-servlet.xml]; nested exception is java.lang.NoClassDefFoundError: javax/xml/namespace/QName

  1. chenjunjun 3 times, last 4 months ago
  2. andyglick 20 times, last 6 months ago
  3. Bugger 1 times, last 11 months ago
27 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.factory.BeanDefinitionStoreException

    Error registering bean with name '' defined in ServletContext resource [config.xml]: Unnamed bean definition specifies neither 'class' nor 'parent' - can't generate name

    at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.generateBeanName()
  2. Spring Beans
    AbstractBeanDefinitionReader.loadBeanDefinitions
    1. org.springframework.beans.factory.support.BeanDefinitionReaderUtils.generateBeanName(BeanDefinitionReaderUtils.java:102)
    2. org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:331)
    3. org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertySubElement(DefaultXmlBeanDefinitionParser.java:660)
    4. org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertyValue(DefaultXmlBeanDefinitionParser.java:650)
    5. org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertyElement(DefaultXmlBeanDefinitionParser.java:593)
    6. org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertyElements(DefaultXmlBeanDefinitionParser.java:492)
    7. org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:360)
    8. org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:328)
    9. org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:265)
    10. org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:185)
    11. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:238)
    12. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:155)
    13. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:99)
    13 frames