Spring 配置文件的头部分

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/java_xuetu/article/details/79953583

Spring的配置文件中会导入很多的命名空间,这下面是所有的命名空间了,全部使用,就可以不用担心在配置文件中使用了某个标签后,配置文件出错了。

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:util="http://www.springframework.org/schema/util"
    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
    http://www.springframework.org/schema/aop 
    http://www.springframework.org/schema/aop/spring-aop.xsd 
    http://www.springframework.org/schema/tx       
    http://www.springframework.org/schema/tx/spring-tx.xsd ">

	
</beans>



Struts2.3.14+Spring3.2+Hibernate4.2.1配置文件头问题

05-10

Struts2.3.14+Spring3.2+Hibernate4.2.1配置文件头问题rn我的配置文件applicationContext-dataSource.xml内容:rn[code=java]rnrnrn rn rn classpath:c3p0.propertiesrn rn rn rn rn rn rn rn $oracle.driverClassrn rn rn $oracle.jdbcUrlrn rn rn $oracle.userrn rn rn $oracle.passwordrn rn rn $c3p0.minPoolSizern rn rn $c3p0.maxPoolSizern rn rn $c3p0.initialPoolSizern rn rn $c3p0.maxIdleTimern rn rn $c3p0.maxStatementsrn rn rn $c3p0.acquireIncrementrn rn rn $c3p0.acquireRetryAttemptsrn rn rn $c3p0.acquireRetryDelayrn rn rn $c3p0.testConnectionOnCheckinrn rn rn $c3p0.automaticTestTablern rn rn $c3p0.idleConnectionTestPeriodrn rn rn $c3p0.checkoutTimeoutrn rn rnrnrn rn rn rn rn rn rn rn rn rn rn $hibernate.oracle.dialectrn rn rn rn $hibernate.show_sqlrn rn $hibernate.format_sqlrn $hibernate.generate_statisticsrn rn $hibernate.jdbc.fatch_sizern $hibernate.cache.use_query_cachern rn rn org.hibernate.cache.EhCacheRegionFactoryrn rn rn rn rn rn rn rn rn com/ccland/model/FileStorage.hbm.xmlrn rn rn rnrn[/code]rn产生的错误如下:rnrn[code=java]2013-5-10 19:02:50 org.apache.catalina.core.AprLifecycleListener initrn信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Users\zhongdc\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;C:\tomcat7\binrn2013-5-10 19:02:51 org.apache.coyote.AbstractProtocol initrn信息: Initializing ProtocolHandler ["http-bio-8080"]rn2013-5-10 19:02:51 org.apache.coyote.AbstractProtocol initrn信息: Initializing ProtocolHandler ["ajp-bio-8009"]rn2013-5-10 19:02:51 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 684 msrn2013-5-10 19:02:51 org.apache.catalina.core.StandardService startInternalrn信息: Starting service Catalinarn2013-5-10 19:02:51 org.apache.catalina.core.StandardEngine startInternalrn信息: Starting Servlet Engine: Apache Tomcat/7.0.16rn2013-5-10 19:02:51 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory docsrn2013-5-10 19:02:51 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory examplesrn2013-5-10 19:02:51 org.apache.catalina.core.ApplicationContext logrn信息: ContextListener: contextInitialized()rn2013-5-10 19:02:51 org.apache.catalina.core.ApplicationContext logrn信息: SessionListener: contextInitialized()rn2013-5-10 19:02:51 org.apache.catalina.core.ApplicationContext logrn信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@6745b9')rn2013-5-10 19:02:51 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory host-managerrn2013-5-10 19:02:52 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory managerrn2013-5-10 19:02:52 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory ROOTrn2013-5-10 19:02:52 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory WebServiceDemorn2013-5-10 19:04:13 org.apache.catalina.core.ApplicationContext logrn信息: No Spring WebApplicationInitializer types detected on classpathrn2013-5-10 19:04:13 org.apache.catalina.core.ApplicationContext logrn信息: Set web app root system property: 'webApp.root' = [C:\tomcat7\webapps\WebServiceDemo\]rn2013-5-10 19:04:14 org.apache.catalina.core.ApplicationContext logrn信息: Initializing log4j from [C:\tomcat7\webapps\WebServiceDemo\WEB-INF\classes\log4j.properties]rn2013-5-10 19:04:14 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContextrn19:04:14,362 INFO ContextLoader:273 - Root WebApplicationContext: initialization startedrn19:04:14,432 INFO XmlWebApplicationContext:510 - Refreshing Root WebApplicationContext: startup date [Fri May 10 19:04:14 CST 2013]; root of context hierarchyrn19:04:14,479 INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from class path resource [applicationContext-dataSource.xml]rn19:04:14,664 ERROR ContextLoader:319 - Context initialization failedrnorg.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 95 in XML document from class path resource [applicationContext-dataSource.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'property'. One of '"http://www.springframework.org/schema/beans":prop' is expected.rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)rn at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)rn at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)rn at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)rn at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)rn at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)rn at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)rn at java.util.concurrent.FutureTask.run(FutureTask.java:138)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'property'. One of '"http://www.springframework.org/schema/beans":prop' is expected.rn[/code]rnrn看这意思,新的规范是不支持标签了,不知道该如何写,或者头文件该如何修改?rnrn

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试