bombone 2009-07-22 18:23
浏览 267
已采纳

关于applicationContext.xml的配置

在网上看到一篇关于struts2+spring+hibernate的文章,其中spring的配置文件分为三个:
applicationContext-actions.xml
applicationContext-beans.xml
applicationContext-common.xml
其中applicationContext-common.xml文件内容如下:
[code="xml"]
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
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-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">

<!-- 配置sessionFactory -->
<bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="configLocation">
        <value>classpath:hibernate.cfg.xml</value>
    </property>
</bean>

<!-- 配置事务管理器 -->
<bean id="transactionManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory">
        <ref bean="sessionFactory" />
    </property>
</bean>

<!-- 配置事务的传播特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
        <tx:method name="add*" propagation="REQUIRED" />
        <tx:method name="delete*" propagation="REQUIRED" />
        <tx:method name="modify*" propagation="REQUIRED" />
        <tx:method name="*" read-only="true" />
    </tx:attributes>
</tx:advice>

<!-- 那些类的哪些方法参与事务 -->
<aop:config>
    <aop:advisor pointcut="execution(* com.test.manager.*.*(..))"
        advice-ref="txAdvice" />
</aop:config>


[/code]
使用的MyEclipse5.5,配置文件的最后:aop:config报错,错误信息如下:

[img]/upload/attachment/127825/40d86512-8810-3ace-8d4a-b3f905d7bd01.jpg[/img]

请问可能的错误原因是什么?

[b]问题补充:[/b]
wcp_010 (初级程序员) :没有看出哪里错了。
pan_java (中级程序员):你的方法试了,还是不行,报错。
[b]问题补充:[/b]
jansel (初级程序员) ,你的回答帮我解决了问题。
就是因为MyEclipse中的XML Catalog 里面有没有配置Spring aop。
同时,通过"MyEclipse中的XML Catalog"这个关键词,还找到了解决MyEclipse的xml验证速度过慢的解决办法。
在此,表示感谢!(这个问题已经折腾我2天了)

  • 写回答

4条回答 默认 最新

  • iteye_15225 2009-07-23 09:13
    关注

    十有八九是没有找到XSD文件,可以看一下MyEclipse中的XML Catalog 里面有没有配置Spring aop,如果配置了更新一下这个XSD就可以了。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?