请问可有人遇到过这个问题啊?eclipse中的maven项目配置spring和mybatis是报错,请指教

Tatum_99999
领域专家: 后端开发技术领域
2014-12-30 03:23:53
org.springframework.beans.factory.BeanDefinitionStoreException: Line 21 in XML document from class path resource [applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: 文档根元素 "beans" 必须匹配 DOCTYPE 根 "null"。
org.xml.sax.SAXParseException; lineNumber: 21; columnNumber: 112; 文档根元素 "beans" 必须匹配 DOCTYPE 根 "null"。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:126)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:125)
at org.springframework.context.support.AbstractXmlApplicationContext.refreshBeanFactory(AbstractXmlApplicationContext.java:65)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:226)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:58)
at com.chuangke.test.Test1.test1(Test1.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)



配置文件如下
<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:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd" >

<util:properties id="jdbc" location="classpath:jdbc.properties"/>

<!-- 定义数据源 -->
<bean id="ds"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="url" value="#{jdbc.url}"/>
<property name="driverClassName" value="#{jdbc.driver}"/>
<property name="username" value="#{jdbc.user}"/>
<property name="password" value="#{jdbc.password}"/>
</bean>
...全文
393 3 打赏 收藏 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_16463721 2015-02-04
  • 打赏
  • 举报
回复
我也是这个问题,楼主解决没
Tatum_99999 2014-12-30
  • 打赏
  • 举报
回复
没有少呢,<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="ds" /> <property name="mapperLocations" value="classpath:mapper/*.xml"/> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.chuangke.dao" /> <property name="annotationClass" value="com.chuangke.annotation.MyBatisRepository"/> </bean> </beans>
冥王之锤 2014-12-30
  • 打赏
  • 举报
回复
结尾少个</beans>
源码直接下载地址: https://pan.quark.cn/s/387d7c8f6289 在使用IE浏览器的过程中,偶尔会出现重置为默认配置操作未能顺利完成的现象。这种情况的发生可能源于多种因素,包括注册表项出现偏差、浏览器附加组件之间存在不兼容、操作系统授权设置不当或受到恶意程序影响等。针对这一挑战,我们可以通过一系列系统性的方法来逐一诊断和纠正。首先需要验证当前用户是否具备管理员级别的操作权限。在执行重置配置的操作时,必须确保IE浏览器是以管理员身份启动的。具体操作方式为,使用鼠标右键单击IE程序图标,并从弹出的菜单中选择“以管理员身份运行”这一选项。其次,应当检查是否存在恶意软件。恶意程序有时会非法修改浏览器的配置信息,从而阻碍重置过程的正常进行。用户可以借助Windows系统自带的Microsoft Safety Scanner进行检测,或者选择安装并使用第三方安全防护软件执行全面的系统扫描。紧接着,需要对浏览器的缓存数据以及Cookies文件进行清理。在IE浏览器界面中,通过访问“工具”菜单并选择“Internet选项”,然后在弹出的设置界面中,切换至“常规”标签页,并执行清除浏览历史记录的操作,此过程应包含Cookies和临时互联网文件。倘若上述步骤均未能解决问题,那么可以考虑禁用或移除那些可能引发冲突的浏览器附加组件。相关操作需要在“工具”菜单下找到并打开“管理加载项”,对可疑的插件进行禁用处理,并在浏览器重新启动后再次尝试执行重置操作。再者,修复IE浏览器相关的注册表配置也是至关重要的环节。注册表编辑器是一个功能强大的系统工具,任何不当的操作都可能导致严重的系统问题,因此在进行修改前必须创建系统还原点作为安全备份。用户可以通过按下“Win+R”组合...
内容概要:本文详细介绍了光伏储能虚拟同步发电机(VSG)并网仿真模型的Simulink实现方法,系统研究了光伏发电与储能系统融合VSG技术并入电网的动态特性与控制策略。通过构建完整的VSG控制模块,模拟其在并网过程中的虚拟惯性响应、频率调节能力和有功无功功率支撑特性,验证了该系统在增强电网稳定性、提升新能源并网适应性方面的有效性。模型全面涵盖光伏出力特性、储能系统充放电管理、VSG有功-无功解耦控制、下垂控制机制以及并网点动态响应等关键环节,并通过多种工况下的仿真分析,评估系统在不同运行条件下的动态性能与鲁棒性。; 适合人群:具备电力系统、新能源发电、自动控制等相关专业背景,熟悉Matlab/Simulink仿真环境,从事新能源并网、微电网控制或电力电子系统研究的科研人员、工程技术人员及研究生。; 使用场景及目标:①深入理解光伏储能系统如何通过VSG技术模拟同步发电机的惯性和阻尼特性以支持电网稳定;②掌握虚拟惯量控制、下垂控制等VSG核心控制策略在Simulink中的建模、参数设计与实现方法;③为新型电力系统中新能源并网的动态仿真、稳定性分析及控制策略优化提供可靠的模型基础和技术参考。; 阅读建议:建议结合所提供的仿真模型进行逐步操作与参数调试,重点关注VSG控制环路的结构设计、控制器参数整定及其对系统动态性能的影响,同时可将该模型拓展应用于多机并联、微电网孤岛/并网切换、多能源协同控制等更复杂的系统场景中进行进阶研究。

67,535

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧