在启动项目时报解析xml文件异常:
 
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c 'aop:config'......
 
由报错提示可知,是aop产生的问题,打开配置文件,经过查看后才知道是没有加aop声明:
 
<!--开启基于注解的事务,使用xml配置形式的事务(必要主要的都是使用配置式) -->
<aop:config>
<!-- 切入点表达式 -->
<aop:pointcut expression="execution(* com.dxt.bx.reader.api.service..*(..))" id="txPoint"/>
<!-- 配置事务增强 -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"/>
</aop:config>
 
<!--配置事务增强,事务如何切入 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 所有方法都是事务方法 -->
<tx:method name="*"/>
<!--以xxx开始的所有方法的传播行为 -->
<tx:method name="get*" read-only="true"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="create*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="select*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="get*" propagation="SUPPORTS" read-only="true"/>
</tx:attributes>
</tx:advice>
 
在xml开头加上声明:
 
 
 
加上后就正常了。

spring开启事务时启动报错SAXParseException的更多相关文章

  1. 使用CXF+Spring发布WebService,启动报错

    使用CXF+Spring发布WebService,启动报错,日志如下: 五月 12, 2017 9:01:37 下午 org.apache.tomcat.util.digester.SetProper ...

  2. 笔记本电脑切换到无线热点无法联网问题&Spring Cloud相关工程启动报错问题

    通过禁用本地网络,和禁用另一个无线网络,以及禁用后重开,修改密码,重连的方式均失败后, 使用IE浏览器浏览提示失败,点击诊断,诊断出DNS服务器无响应异常. 突然想到通过ipconfig查看ip,网关 ...

  3. maven创建spring项目之后,启动报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    出错情景:maven中已经加载了spring的核心包,但是项目启动时,报错: org.apache.catalina.core.StandardContext listenerStart严重: Err ...

  4. 【spring boot】整合LCN,启动spring boot2.0.3 启动报错:Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

    spring boot 2.0.3启动报错: Error starting ApplicationContext. To display the conditions report re-run yo ...

  5. 【spring cloud】【spring boot】项目启动报错:Cannot determine embedded database driver class for database type NONE

    解决参考文章:https://blog.csdn.net/hengyunabc/article/details/78762097 spring boot启动报错如下: Error starting A ...

  6. 【spring cloud】子模块启动报错com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect

    spring cloud子模块启动报错 Caused by: java.lang.ClassNotFoundException: com.netflix.hystrix.contrib.javanic ...

  7. 【spring data jpa】启动报错:nested exception is java.util.NoSuchElementException

    spring boot项目中 使用spring data jpa 启动报错: org.springframework.beans.factory.UnsatisfiedDependencyExcept ...

  8. 【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration. 【Mapper类不能被找到】@Mapper 和@MapperScan注解的区别

    启动报错: 2018-05-16 17:22:58.161 ERROR 4080 --- Disconnected from the target VM, address: '127.0.0.1:50 ...

  9. spring cloud gateway网关启动报错:No qualifying bean of type 'org.springframework.web.reactive.DispatcherHandler'

    网关配置好后启动报错如下: org.springframework.context.ApplicationContextException: Unable to start web server; n ...

随机推荐

  1. linux----------阿里云服务器使用过程中遇到的各种问题以及解决渠道

    1.Windows Server 2012 R2 或 2016 无法安装 .NET Framework 3.5.1:  https://help.aliyun.com/knowledge_detail ...

  2. debug调试命令

  3. python locust 性能测试:locust参数-保证并发测试数据唯一性,循环取数据

    from locust import TaskSet, task, HttpLocustimport queue class UserBehavior(TaskSet): @task def test ...

  4. 2019最新WEB前端开发小白必看的学习路线(附学习视频教程)

    2019最新WEB前端开发小白必看的学习路线(附学习视频教程).web前端自学之路:史上最全web学习路线,HTML5是万维网的核心语言,标准通用标记语言下的一个应用超文本标记语言(HTML)的第五次 ...

  5. openGL学习----相机

    0.参考:https://learnopengl-cn.github.io/01%20Getting%20started/09%20Camera/ 0.0其实相机就是搞清楚cameraPos,came ...

  6. php取余运算(%) 注意事项

    <?php //php取余运算(%)的那点事,php取余数用%符号,即为模运算 //理论上应该输出45才对,可是实际运算结果是44 $val=9.45; $result=$val*100; ec ...

  7. 搭建一个Web Server站点

    题:搭建一个Web Server站点.安装web服务,并在本地创建index.html测试 1.安装http服务 yum -y install httpd 2.进入网站目录 cd /var/www/h ...

  8. Maven+SSM框架(Spring+SpringMVC+MyBatis)(二)

    1.基本概念 2.开发环境搭建 3.Maven Web项目创建 4.SSM整合 此次整合我分两个配置文件: 1)分别是spring-mybatis.xml,包含spring和mybatis的配置文件, ...

  9. Python3 tkinter基础 Radiobutton indicatoron 改变按钮的外观 圆形/方形

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  10. win8外包公司——技术分享:参数传递

    页面之间传递参数 windows phone 的参数传递和web 差不多.用“?”号传递 多个参数的时候用 “&”做分隔. 我接着昨天的项目继续添加一个FourPage.xaml 在昨天的Th ...