Java Eclipse 中缺少 JBoss 服务器运行时库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24505418/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 12:38:59  来源:igfitidea点击:

Missing JBoss Server Runtime Library in Eclipse

javaeclipsejbossruntimeclasspath

提问by ggurov

How to add JBoss or JBoss EAP library to the Java Build Path of my project in Eclipse?

如何在 Eclipse 中将 JBoss 或 JBoss EAP 库添加到我的项目的 Java 构建路径中?

My platform: Virtual machine with Windows XP sp3, JDK 7 and JRE 7, Eclipse Java EE IDE for Web Developers (Version: Kepler Service Release 2), new clean workspace in Eclipse

我的平台:带有 Windows XP sp3、JDK 7 和 JRE 7 的虚拟机、面向 Web 开发人员的 Eclipse Java EE IDE(版本:Kepler Service Release 2)、Eclipse 中新的干净工作区

What I did:

我做了什么:

  1. Installed JBoss Tools for Kepler from the Market
  2. Folder with unzipped JBoss EAP - I tried with jboss-eap-6.2.0.zip, jboss-eap-6.3.0.Beta.zip and also install with jboss-eap-6.2.0-installer.jar
  3. Added "JBoss Enterprise Application Platform 6.1+ Runtime" to Eclipse -> Preferences -> Server -> Runtime Enviroments, connected to the mentioned folder and to JDK 7
  4. At this point "JBoss EAP 6.1+ Runtime Server" is shown in View -> Servers and I can start it
  5. Making new Java Project or Dynamic Web Project
  6. In Project properties:
    • Targeted Runtime - "JBoss EAP 6.1+ Runtime" is checked
    • Project Facets -> Runtimes - "JBoss EAP 6.1+ Runtime" is checked
  1. 从市场上为 Kepler 安装 JBoss 工具
  2. 带有解压缩 JBoss EAP 的文件夹 - 我尝试使用 jboss-eap-6.2.0.zip、jboss-eap-6.3.0.Beta.zip 并使用 jboss-eap-6.2.0-installer.jar 安装
  3. 将“JBoss Enterprise Application Platform 6.1+ Runtime”添加到 Eclipse -> Preferences -> Server -> Runtime Enviroments,连接到提到的文件夹和 JDK 7
  4. 此时“JBoss EAP 6.1+ Runtime Server”显示在 View -> Servers 中,我可以启动它
  5. 制作新的 Java 项目或动态 Web 项目
  6. 在项目属性中:
    • Targeted Runtime - "JBoss EAP 6.1+ Runtime" 被选中
    • Project Facets -> Runtimes - 勾选“JBoss EAP 6.1+ Runtime”

Then I go to Java Build Path -> Libraries -> Add Library -> Server Runtime - and the list there is empty.

然后我转到 Java Build Path -> Libraries -> Add Library -> Server Runtime - 那里的列表是空的。

The same problem with JBoss 7.1 Runtime, which I added through download from Eclipse. Empty "Server Runtime" list again.

JBoss 7.1 Runtime 也有同样的问题,我是通过从 Eclipse 下载添加的。再次清空“服务器运行时”列表。

How to fix this?

如何解决这个问题?

I tried a similar procedure with Apache Tomcat 7 and it is OK. But no success with JBoss.

我在 Apache Tomcat 7 上尝试了类似的过程,结果没问题。但是 JBoss 没有成功。

EDIT: here can be something relevant https://community.jboss.org/message/811070They write about "Default Classpath Entries", I don't have such caption in Server -> Runtime Enviroments.

编辑:这里可以是相关的https://community.jboss.org/message/811070他们写的是“默认类路径条目”,我在服务器 - > 运行时环境中没有这样的标题。

采纳答案by ggurov

The problem is solved with the last (currently) Eclipse - Luna Service Release 1 (Eclipse 4.4.1) - and JBoss Tools 4.2 for it.

最后一个(当前)Eclipse - Luna Service Release 1 (Eclipse 4.4.1) - 和 JBoss Tools 4.2 解决了这个问题。

回答by swapjo

I can't speak as to how/why/when it was created, but look in the hidden folders inside your project. A file by the name of ‘org.eclipse.wst.common.project.facet.core.xml” exists and isn't understood by MyEclipse. Delete it and the error should go away. Mine did.

我不能说它是如何/为什么/何时创建的,但请查看项目中的隐藏文件夹。存在名为“org.eclipse.wst.common.project.facet.core.xml”的文件,MyEclipse 无法识别该文件。删除它,错误应该消失。我的做到了。

回答by Sangram Badi

i think this error because of some missing jar like jboss client jar. in your project. so try to add this jar in you project.

我认为这个错误是因为缺少一些 jar,比如 jboss 客户端 jar。在你的项目中。所以尝试在你的项目中添加这个 jar。

Right click on java project -> build path -> configure build path ->
 libreries -> add external jars or add jars -> browse jboss client jar -> applay -> ok.

it was working for me.

它对我有用。