eclipse 在以下过程中发生内部错误:“正在加载 <Web 项目> 的描述符。”。java.lang.NullPointerException

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

An internal error occurred during: "Loading descriptor for <Web Project>.". java.lang.NullPointerException

javaeclipseservlets

提问by RoshP

I just downloaded Eclipse Luna on my new laptop and as soon as I have created a new Dynamic Web project and try to expand the project in the explorer, I get this error message:

我刚刚在我的新笔记本电脑上下载了 Eclipse Luna,一旦我创建了一个新的动态 Web 项目并尝试在资源管理器中扩展该项目,我就会收到以下错误消息:

"An internal error occurred during: "Loading descriptor for WebProjectTest.".
java.lang.NullPointerException"

I initially ignored the message, but when I go to add a servlet through the 'create servlet' window and type a name for the class I'm unable to press 'next'.

我最初忽略了这条消息,但是当我通过“创建 servlet”窗口添加一个 servlet 并为类输入一个名称时,我无法按“下一步”。

I have Java 1.7 installed and had no problems at all using Eclipse Juno on my old laptop

我安装了 Java 1.7,在旧笔记本电脑上使用 Eclipse Juno 完全没有问题

回答by Uncle Long Hair

I just had this problem and realized that it was because I had accidentally downloaded the non-J2EE version of Eclipse. It looks like the plugins and Eclipse itself does not recognize that you're asking it to to J2EE things in a non-J2EE app and will throw mysterious errors and exceptions like this. My solution was to start over and download the J2EE version of Eclipse and reload the project in that.

我刚遇到这个问题,意识到这是因为我不小心下载了非 J2EE 版本的 Eclipse。看起来插件和 Eclipse 本身无法识别您在非 J2EE 应用程序中要求它处理 J2EE 的东西,并且会抛出像这样的神秘错误和异常。我的解决方案是重新开始并下载 Eclipse 的 J2EE 版本并在其中重新加载项目。

I think it might be possible to upgrade a non-J2EE Eclipse by downloading all of the right tools but it is probably simpler to just re-download it.

我认为可以通过下载所有正确的工具来升级非 J2EE Eclipse,但重新下载它可能更简单。

回答by Roman C

Remove a descriptor, as far as servlet 3.0spec the web project doesn't required to use web project deployment descriptor. If a descriptor is a main cause of the error then it would solve you first problem. The second problem required some mode details. If the button is disabled it might be an internal error, or restricted behavior of the control. You need to use a stable release to have less bugs.

删除描述符,就servlet 3.0规范而言,Web 项目不需要使用 Web 项目部署描述符。如果描述符是错误的主要原因,那么它将解决您的第一个问题。第二个问题需要一些模式细节。如果按钮被禁用,则可能是内部错误或控件的受限行为。您需要使用稳定版本才能减少错误。