eclipse 动态 Web 项目错误“加载描述符”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23016408/
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-09-10 22:03:16  来源:igfitidea点击:

Dynamic Web project Error "Loading descriptor"

eclipse

提问by KawtarHB

In the process of trying to build an android web service using Spring under Eclipse IDE, I need to create a Dynamic Web Project using Maven. The problem I am facing is an error " Loading descriptor for project has encountered a problem. I don't know how to solve this. Any input on that?

在Eclipse IDE下尝试使用Spring构建android web service的过程中,需要使用Maven创建一个Dynamic Web Project。我面临的问题是一个错误“加载项目描述符遇到问题。我不知道如何解决这个问题。对此有任何意见吗?

回答by DuKes0mE

If you get the following exception:

如果您收到以下异常:

Loading descriptor for project has encountered a problem. [...] Nullpointerexception

加载项目描述符时遇到问题。[...] 空指针异常

right after creating a project, then there are 2 possible causes (or at least that how it was for me, when I had this issue).

在创建项目之后,有 2 个可能的原因(或者至少是我遇到这个问题时的情况)。

1) A web.xml file is missing in your WebContent/WEB-INF folderor was not created during project creation. (in the last window you have to check option "Generate web.xml deployment descriptor" in eclipse, otherwise eclipse won't generate that file)

1) web.xml 文件在您的 WebContent/WEB-INF 文件夹中丢失或不是在项目创建过程中创建的。(在最后一个窗口中,您必须在 eclipse 中选中“生成 web.xml 部署描述符”选项,否则 eclipse 不会生成该文件)

If your project is already created, you can still add a web.xml file into your WEB-INFdirectory. Depending on your servlet version (e.g. 2.5) you have to use a different template which can be found on the net.

如果您的项目已经创建,您仍然可以将 web.xml 文件添加到您的WEB-INF目录中。根据您的 servlet 版本(例如 2.5),您必须使用不同的模板,该模板可以在网上找到。

2) Your Eclipse does not have all the necessary plugins for Dynamic Web projects.
You need to go to Help>> Install new Software
Select the site which corresponds to your eclipse version. (e.g. Kepler - http://download.eclipse.org/releases/kepler)

2)您的 Eclipse 没有动态 Web 项目所需的所有插件
您需要转到帮助>>安装新软件
选择与您的 Eclipse 版本相对应的站点。(例如开普勒 - http://download.eclipse.org/releases/kepler

Install:

安装:

  1. JST Server UI
  2. JST Web UI
  3. JST Server Adapters
  4. JST Server Adapters Extension
  5. WST Server Adapters.
  1. JST 服务器界面
  2. JST 网页界面
  3. JST 服务器适配器
  4. JST 服务器适配器扩展
  5. WST 服务器适配器。

You may also need:

您可能还需要:

  1. Eclipse Java EE Developer tools
  2. Eclipse Java Web Developer tools
  3. Java Server Faces tools or JSF tools
  4. Eclipse faceted Project Framework
  5. Eclipse faceted Project Framework JDT Enablement

  1. Eclipse Java EE 开发人员工具
  2. Eclipse Java Web 开发人员工具
  3. Java Server Faces 工具或 JSF 工具
  4. Eclipse 多面项目框架
  5. Eclipse 多面项目框架 JDT 启用

回答by kunal

I know this is late but may be useful for others. In web.xml there may be some attribute repated in web-app tag. In my case xmlns="http://java.sun.com/xml/ns/javaee" attribute in repeated in tag web-app.

我知道这已经晚了,但可能对其他人有用。在 web.xml 中,可能有一些属性在 web-app 标签中重复。在我的例子中,xmlns="http://java.sun.com/xml/ns/javaee" 属性在标签 web-app 中重复。

回答by aish

  1. install Java EE web developer tools from Help >> "Install new Software".
  2. check in project properties "Project Facets" should have proper check boxes enabled eg Dynamic Web Project etc.
  1. 从“帮助”>>“安装新软件”安装 Java EE Web 开发人员工具。
  2. 签入项目属性“项目方面”应该启用适当的复选框,例如动态 Web 项目等。

回答by Tom Brito

Install Eclipse Java Development toolsfrom Help >> "Install new Software".

从“帮助”>>“安装新软件”安装Eclipse Java 开发工具