STS不显示要与新的Spring Bean定义一起使用的XSD名称空间

时间:2012-05-05 06:46:45

标签: spring javabeans spring-ide

我是Spring框架的新手,我正在学习本教程:http://www.vaannila.com/spring/spring-ide-1.html

根据教程,当我添加一个Spring Bean配置文件时,我应该能够选择一些XSD命名空间用于新的Spring Bean定义,如下所示:image_1

但是当我添加它时,它不会显示如下:image_2

我怎么能弄清楚这一点?

提前致谢。

* ps:我不知道它对你有帮助,但我正在使用sts 2.9.1。在Windows 7 os上发布

编辑:根据@gkamal,有些软件包丢失了。这是我项目的包浏览器的内容:Package Explorer Screen Shot

5 个答案:

答案 0 :(得分:8)

您的项目中没有spring jar文件。命名空间&从项目类路径中的jar中扫描XSD。

要么你或你的项目不是一个春天项目 - 尝试将spring属性添加到你的项目中。

答案 1 :(得分:3)

请参阅下面的JARs库命名空间列表。 因此,您必须在项目类路径中添加相应的JAR以获取所需的命名空间。

org.springframework.aop_3.1.1.RELEASE.jar
•   aop – "http://www.springframework.org/schema/aop"
org.springframework.transaction_3.1.1.RELEASE.jar
•   tx - "http://www/springframework.org/schema/tx"
org.springframework.beans_3.1.1.RELEASE.jar
•   beans – "http://www/springframework.org/schema/beans"
•   c – "http://www/springframework.org/schema/c"
•   p - "http://www/springframework.org/schema/p"
•   util - "http://www/springframework.org/schema/util"
org.springframework.jms_3.1.1.RELEASE.jar
•   jms - "http://www/springframework.org/schema/jms"
org.springframework.context_3.1.1.RELEASE.jar
•   cache - "http://www/springframework.org/schema/cache"
•   context - "http://www/springframework.org/schema/context"
•   jee - "http://www/springframework.org/schema/jee"
•   lang - "http://www/springframework.org/schema/lang"
•   task - "http://www/springframework.org/schema/task"
org.springframework.jdbc_3.1.1.RELEASE.jar
•   jdbc - "http://www/springframework.org/schema/jdbc"
org.springframework.osgi.core_2.0.0.M2-SNAPSHOT.jar
•   bp - "http://www/osgi.org/xmlns/blueprint/v1.0.0"
•   osgi - "http://www/springframework.org/schema/osgi"
•   osgix - "http://www/springframework.org/schema/osgi-compendium"
org.springframework.oxm_3.1.1.RELEASE.jar
•   oxm - "http://www/springframework.org/schema/oxm"

答案 2 :(得分:0)

如果您确定所有的罐子都在那里,那么关闭并打开项目

答案 3 :(得分:0)

答案是转到属性和设置选项,如下所示: The answer

答案 4 :(得分:0)

STS 4 ->Prefrence ->Spring ->Namespaces

只需取消选中“加载命名空间”处理程序和XSD,即可形成项目的类路径。 因为每次ide都要在classpath中寻找名称空间。