Veg*_*ard 3 java spring intellij-idea
我已经定义了以下事务管理器:
<tx:annotation-driven transaction-manager="txManager" mode="aspectj" />
Run Code Online (Sandbox Code Playgroud)
并具有以下根元素:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
Run Code Online (Sandbox Code Playgroud)
一切正常,但IntelliJ在mode ="aspectj"上给我一个错误标记, 说不允许.我已经跟随它获取xsd的位置,它链接到tx 2.0 xsd - 这解释了错误消息,因为我需要2.5来使用模式注释.
有可能以某种方式给IntelliJ一个提示,我应该向2.5而不是2.0验证?
如果schemaLocation根据此屏幕截图打开应该指向xsd 的jar文件:

然后你会看到IntelliJ有一堆不同版本的Spring的xsd文件:

这意味着您确实拥有所需的所有模式.
如果您的bean定义文件有问题,那么您schemaLocation必须指向Spring jar文件中的错误版本:

检查Settings | Schemas and DTDs并确认您没有意外地手动将其设置为指向错误的xsd文件:

如果它是错的,那么你将不得不使用减号删除该行.这将导致IntelliJ返回其默认值:

在那之后你应该看到与第一个屏幕截图相同的东西.
| 归档时间: |
|
| 查看次数: |
3059 次 |
| 最近记录: |