当我刷新动态Web项目(或保存文件)时,它会遇到错误。它实际上通常会显示三次相同的错误。
我在这里看到的其他答案表明只有在创建新项目时才会发生这种情况。这最近才开始发生。
查看workspace / .metadata / .log会显示一系列错误:
!ENTRY org.eclipse.jst.j2ee 4 0 2015-05-15 15:20:16.141
!MESSAGE No IModelProvider exists for project P/MyWebProject of version: Dynamic Web Module 2.5
!STACK 0
java.lang.NullPointerException: No IModelProvider exists for project P/MyWebProject of version: Dynamic Web Module 2.5
at org.eclipse.jst.j2ee.model.ModelProviderManager.getModelProvider(ModelProviderManager.java:101)
at org.eclipse.jst.j2ee.model.ModelProviderManager.getModelProvider(ModelProviderManager.java:281)
at org.eclipse.jst.jee.ui.internal.navigator.JEE5ContentProvider.getCachedModelProvider(JEE5ContentProvider.java:76)
at org.eclipse.jst.jee.ui.internal.navigator.Web25ContentProvider.getNewContentProviderInstance(Web25ContentProvider.java:69)
at org.eclipse.jst.jee.ui.internal.navigator.LoadingJeeDDJob.run(LoadingJeeDDJob.java:50)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
!ENTRY org.eclipse.core.jobs 4 2 2015-05-15 15:20:16.141
!MESSAGE An internal error occurred during: "Loading descriptor for MyWebProject.".
!STACK 0
java.lang.NullPointerException
at org.eclipse.jst.jee.ui.internal.navigator.JEE5ContentProvider.getCachedModelProvider(JEE5ContentProvider.java:77)
at org.eclipse.jst.jee.ui.internal.navigator.Web25ContentProvider.getNewContentProviderInstance(Web25ContentProvider.java:69)
at org.eclipse.jst.jee.ui.internal.navigator.LoadingJeeDDJob.run(LoadingJeeDDJob.java:50)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
答案 0 :(得分:2)
这个问题以多种形式出现,例如
Error when creating a new Vaadin project in eclipse
解决方案:安装以下内容:
(在我的例子中,缺少Eclipse Java Web Developer Tools。)
答案 1 :(得分:1)
您的web.xml将错误。检查任何servlet映射是否有无效的类,然后删除该映射并清理您的项目。
答案 2 :(得分:-3)
删除项目并重新检查它解决了这个问题。