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 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题