'Invalid element name: - property One of the following is expected: - import - alias - bean - WC[##other:"http://www.springframework.org/schema/beans"]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<bean name="employee" class="com.bharath.spring.springcore.innerbeans.Employee" p:id="123"/>
<property name="address">
<bean class="com.bharath.spring.springcore.innerbeans.Address" p:hno="700" p:street="BANK MORE" p:city="DHANBAD"/>
</property>
</beans>
getting the error mentioned in the question heading line. below is the error
Invalid element name: - property One of the following is expected: - import - alias - bean - WC[##other:"http://www.springframework.org/schema/beans"] - beans Error indicated by: {http://www.springframework.org/schema/beans} with code:
Solution 1:[1]
Property must be a child element of bean
<bean name="employee" class="com.bharath.spring.springcore.innerbeans.Employee" p:id="123">
<property name="address">
</bean>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Raul Lapeira Herrero |
