This error is due to incorrect parsing of the xml file.
Using Eclipse to validate it gives the error:
cvc-complex-type.2.3: 元素豆类不能具有特性[子女],因为内容类型只是元素。
在<代码><bean>各项声明之间似乎有些奇怪。 您是否从其他地方读过这一案文?
在<代码><bean>下定义之间移除所有空间和新线特性,并将其带回编辑。
UPDATE
Copying & pasting into notepad++ the text in the codepaste you provided, and setting the charset to UTF-8 showed these characters in the blank lines: xA0. This is the standard Unicode translation for
. This is likely to be the cause of this problem.
This validates ok for me:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/HibernateDB" />
<property name="username" value="HibernateDB" />
<property name="password" value="java" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration" />
<property name="annotatedClasses">
<list>
<value>hdao.HibernateObject</value>
</list>
</property>
</bean><bean id="springHibernateOperator" class="hdao.SpringHibernateOperatorImplementation">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
</beans>