Home  >  Forum  >  Spring
Post New Query

cvc-complex-type.2.4.c: The matching wildcard is strict



Asked on December 21, 2013
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'bean'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388)

I added a bean in my bean declaration XML, and got error. What may be wrong? 



Replied on December 21, 2013
declaration can be found for element 'bean'

As error is saying that no declaration can be found for element 'bean', so you need to check 

1.  xml definition for bean schema location is present
2. root bean tag is present as

<beans>

</beans>

or

<beans: beans>

</beans: beans>




Replied on December 21, 2013
if you have parent bean as 
<beans: beans>
</beans: beans>

then your child bean must be like

<beans: bean>
</beans: bean>


Write Answer




©2019 concretepage.com | Privacy Policy | Contact Us