ApplicationContext.xml文件报错:
cvc-complex-type.2.3: Element 'props' cannot have character [children], because the type's content type is element-only.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-2.5.xsd">
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url"
value="jdbc:mysql://localhost:3306/study">
</property>
<property name="username" value="root"></property>
<property name="password" value="zjm1982"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
</props><!--此行报错-->
</property>
<property name="mappingResources">
<list>
<value>com/zjm/books/pojo/Tree.hbm.xml</value>
<value>com/zjm/books/pojo/Userdb.hbm.xml</value>
<value>com/zjm/books/pojo/Codedb.hbm.xml</value>
<value>com/zjm/books/pojo/Popedom.hbm.xml</value></list>
</property>
</bean>
</beans>
ehcache.xml
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd">
<diskStore path="java.io.tmpdir" />
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU" />
</ehcache>
cvc-complex-type.2.3: Element 'props' cannot have character [children], because the type's content type is element-only.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-2.5.xsd">
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url"
value="jdbc:mysql://localhost:3306/study">
</property>
<property name="username" value="root"></property>
<property name="password" value="zjm1982"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
</props><!--此行报错-->
</property>
<property name="mappingResources">
<list>
<value>com/zjm/books/pojo/Tree.hbm.xml</value>
<value>com/zjm/books/pojo/Userdb.hbm.xml</value>
<value>com/zjm/books/pojo/Codedb.hbm.xml</value>
<value>com/zjm/books/pojo/Popedom.hbm.xml</value></list>
</property>
</bean>
</beans>
ehcache.xml
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd">
<diskStore path="java.io.tmpdir" />
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU" />
</ehcache>
解决方案 »
- 关于一段ExtJs请求Action下载文件的代码,请大师解决
- 怎么解决Could not initialize class org.apache.commons.beanutils.BeanUtils啊
- could not initialize proxy - no Session
- GBK 和 UTF-8它们的区别
- http上传附件和https上传附件
- 进来接分 MYSQL 一些心得????
- 想写个检测cpu利用率占用100%后执行sql里的存储过程,能实现吗?
- 在线求解
- 菜鸟请教。J2EE的基本概念
- 关于Weblogic初级问题
- spring 注解 @Autowired 和 @Inject 两个功能是一样的吗
- Dao注入不了
解决方法:
可以把<bean></bean>一个一个的粘贴上去保存看提不提示出错,然后找到出错的<bean></bean>仔细检查下应该就可以找到错误了。