IntelliJ IDEA验证错误的XSD [英] IntelliJ IDEA validates toward wrong XSD

查看:516
本文介绍了IntelliJ IDEA验证错误的XSD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经定义了以下事务管理器:

I have defined the following transaction manager:

    <tx:annotation-driven transaction-manager="txManager" mode="aspectj" />

并具有以下根元素:

<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">

一切正常,但IntelliJ在
上给我一个错误标记模式= aspectj
说不允许。我已经跟随它获取xsd的位置,它链接到tx 2.0 xsd - 这解释了错误消息,因为我需要2.5来使用模式注释。

Everything works fine, but IntelliJ gives me a error marker on mode="aspectj" saying it is not allowed. I have followed where it gets the xsd from, and it links to the tx 2.0 xsd - which explains the error message, as I need 2.5 to use the mode annotation.

是否有可能以某种方式向IntelliJ提示我应该向2.5而​​不是2.0验证?

Is it possible to somehow give IntelliJ a hint that i should validate toward 2.5 rather than 2.0?

推荐答案

如果你打开jar文件 schemaLocation 应根据此屏幕截图指向xsd:

If you open up the jar file that the schemaLocation should point to the xsd according to this screen shot:

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

Then you'll see that IntelliJ has a bunch of xsd files for different versions of Spring:

这意味着您确实拥有所需的所有模式。

This means that you really have all the schemas you need.

如果您的bean定义文件有问题然后你的 schemaLocation 必须指向Spring jar文件中的错误版本:

If your bean definitions file has problems then your schemaLocation must point to the wrong version in the Spring jar file:

检查设置|模式和DTD 并验证您没有意外地手动将其设置为指向错误的xsd文件:

Check the Settings | Schemas and DTDs and verify that you haven't accidentally manually set it to point to the wrong xsd file:


如果错误,则必须使用减号删除该行。这将导致IntelliJ返回其默认值:

If it is wrong then you'll have to remove that line using the minus sign. This will cause IntelliJ to go back to it's default values:

之后您应该看到与第一个屏幕截图相同的内容。

After that you should be seeing the same thing as in the first screen shot.

这篇关于IntelliJ IDEA验证错误的XSD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆