简体   繁体   English

STS 不显示用于新 Spring Bean 定义的 XSD 命名空间

[英]STS doesn't show XSD namespaces to use with new Spring Bean Definition

i'm very new with spring framework and i was following this tutorial : http://www.vaannila.com/spring/spring-ide-1.html我对 spring 框架很陌生,我正在学习本教程: http : //www.vaannila.com/spring/spring-ide-1.html

According to tutorial, when i added a Spring Bean Configuration File, i should be able to select some XSD namespaces to use with new Spring Bean Definition like this :根据教程,当我添加 Spring Bean 配置文件时,我应该能够选择一些 XSD 命名空间以与新的 Spring Bean 定义一起使用,如下所示:图像_1

But when i add it, it doesn't show anything like this :但是当我添加它时,它没有显示如下内容:图像_2

How can i figure this out?我怎么能弄明白呢?

Thanks in advance.提前致谢。

*ps: i don't know does it help you but i'm using sts 2.9.1. *ps:我不知道它对你有帮助,但我使用的是 sts 2.9.1。 release on windows 7 os在 Windows 7 操作系统上发布

edit: according to @gkamal, some packages are missing.编辑:根据@gkamal,缺少一些软件包。 This is the content of my project's package explorer:这是我的项目包浏览器的内容:包浏览器屏幕截图

You don't have the spring jar files in your project.您的项目中没有 spring jar 文件。 The namespaces & XSDs are scanned from the jars in your projects class path.命名空间和 XSD 是从项目类路径中的 jar 文件中扫描出来的。

Either that or you project is not a spring project - try adding the spring nature to your project.要么你的项目不是一个 spring 项目 - 尝试将 spring 性质添加到你的项目中。

See below, the list of namespaces by JARs library.请参阅下面的 JAR 库命名空间列表。 So you have to add the corresponding JAR in your project class path to get the namespaces you need.所以你必须在你的项目类路径中添加相应的 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"

如果您确定所有 jar 都在那里,请关闭并打开项目

The answer is going to properties and setting options as shown here:答案是属性和设置选项,如下所示: 答案

STS 4 ->Prefrence ->Spring ->Namespaces STS 4 -> 偏好 -> Spring -> 命名空间

Just uncheck the Load Namespace handlers and XSDs form projects's classpath that will come.只需取消选中将出现的加载命名空间处理程序和 XSD 表单项目的类路径。 Beacuse everytime ide is looking for the namespaces in classpath.因为每次 ide 都在寻找类路径中的命名空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM