在根元素之前的文档中的标记必须在applicationContext中格式良好

时间:2014-02-04 11:45:56

标签: spring hibernate

我是Spring和hibernate的新手。虽然尝试执行一个简单的例子我得到了以下错误。请帮助

以下是我的applicationContext.xml

<?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:p="http://www.springframework.org/schema/p"  
    xsi:schemaLocation="http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> 
   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
   <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
   <property name="url" value=""/>
   <property name="username" value="uname"/>
   <property name="password" value="pwd"/>
   </bean> 
   <bean id="mySessionFactory" 
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
   <property name="dataSource" ref="dataSource"></property>
   <property name="mappingResources">
   <list>
   <value>Employee.hbm.xml</value>
   </list>
   </property>
   <property name="hibernateProperties">
   <props>
   <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop> 
   <prop key="hibernate.show_sql">true</prop>
   </props>
   </property>
   </bean>
   <bean id="empl" class="com.pgn.sprnghiber.domain.Employee">
   <property name="sessionFactory" ref="mySessionFactory"></property>
   </bean>
   </beans>

0 个答案:

没有答案