Eclipse FeatureNotFoundException

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

Eclipse FeatureNotFoundException

eclipseweb.xml

提问by Reddy

I have built my project with maven All builds successful and eclipse properties generation is also successful

我已经用 maven 构建了我的项目所有构建成功并且 eclipse 属性生成也成功

But when I open the project in Eclipse 4, I am getting this error

但是当我在 Eclipse 4 中打开项目时,我收到此错误

An internal error occurred during: "Loading descriptor for SALYExplorer.".
org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'taglib' not found. (platform:/resource/SALYExplorer/src/main/webapp/WEB-INF/web.xml, 313, 10)

At that location I have some properties

在那个位置我有一些财产

Though the project runs smoothly and everything is fine, just while exploring the project in Navigation pane, Eclipse always throws this error box (quite annoying).

虽然项目运行顺利,一切正常,只是在导航窗格中浏览项目时,Eclipse总是抛出这个错误框(很烦人)。

COde at that location

该位置的代码

<taglib>
    <taglib-uri>xx.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/xx.tld</taglib-location>
</taglib>

and xx definations int it's file

和 xx 定义 int 它的文件

<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
     "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">
<taglib>

  <tlib-version>1.0</tlib-version>
  <jsp-version>1.2</jsp-version>
.........
</taglib>

回答by Henrik

The problem is not the taglib at all, it's just a bad error description by Eclipse.

问题根本不在于 taglib,而只是 Eclipse 的错误描述。

it is the project facet vs. web.xml dtd.. their versions must match!

这是项目方面与 web.xml dtd .. 他们的版本必须匹配!

if the web.xml says:

如果 web.xml 说:

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

but the project has a

但该项目有一个

 "Dynamic Web Module 2.5"

then this error will occur.. change facet to 2.3 or web.xml to 2.5... in other words: they must match..

那么这个错误就会发生..将 facet 更改为 2.3 或将 web.xml 更改为 2.5... 换句话说:它们必须匹配..

回答by A4L

I ran into this error while trying to update a maven project in Eclipse (ALT+F5).

我在 Eclipse (ALT+F5) 中尝试更新 Maven 项目时遇到了这个错误。

web.xml

网页.xml

<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
    schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

and project facet

和项目方面

Dynamic Web Modul 3.0

Here is how I could fix it:

这是我修复它的方法:

Removed all xmls-schema definition from the web-appelement

web-app元素中删除了所有 xmls-schema 定义

<web-app>

then update the maven project (ALT+F5).

然后更新 Maven 项目(ALT+F5)。

Re-insert the schema definitions and re-update project (ALT+F5).

重新插入架构定义并重新更新项目 (ALT+F5)。

回答by CodeMonkey

According to jsp_2_1.xsd included from web-app_2_5.xsd, taglib tag should be in jsp-config tag:

根据 web-app_2_5.xsd 中包含的 jsp_2_1.xsd,taglib 标签应该在 jsp-config 标签中:

<xsd:complexType name="jsp-configType">
<xsd:annotation>
  <xsd:documentation>

The jsp-configType is used to provide global configuration
information for the JSP files in a web application. It has
two subelements, taglib and jsp-property-group.

  </xsd:documentation>
</xsd:annotation>

<xsd:sequence>
  <xsd:element name="taglib"
       type="javaee:taglibType"
       minOccurs="0"
       maxOccurs="unbounded"/>
  <xsd:element name="jsp-property-group"
       type="javaee:jsp-property-groupType"
       minOccurs="0"
       maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID"/>

When I wrapped taglib in js-config, the error disappeared.

当我在 js-config 中包装 taglib 时,错误消失了。

<jsp-config>
    <taglib>
        <taglib-uri>http://www.springframework.org/tags/form</taglib-uri>
        <taglib-location>/WEB-INF/taglibs/spring-form.tld</taglib-location>
    </taglib>
</jsp-config>

Previous parsers were probably more lenient. My config: Eclipse Luna, built-in maven 3.2.1, web.xml 2.5, Dynamic Web Project facet 2.5.

以前的解析器可能更宽松。我的配置:Eclipse Luna,内置maven 3.2.1,web.xml 2.5,Dynamic Web Project facet 2.5。

回答by Kritika Anand

In my case, this problem got resolved by using the version

就我而言,这个问题通过使用版本解决了

org.eclipse.emf.ecore.xmi_2.10.2.v20150123-0348and org.eclipse.emf.ecore.xmi.source_2.10.2.v20150123-0348and org.eclipse.emf.ecore.xmi_2.10.2.v20150123-0348and org.eclipse.emf.ecore.xmi.source_2.10.2.v20150123-0348and org.eclipse.emf.common_2.10.1.v20150123-0348

org.eclipse.emf.ecore.xmi_2.10.2.v20150123-0348org.eclipse.emf.ecore.xmi.source_2.10.2.v20150123-0348org.eclipse.emf.ecore.xmi_2.10.2.v20150123-0348org.eclipse.emf.ecore.xmi.source_2.10.2.v20150123-0348org.eclipse.emf.common_2.10.1.v20150123-0348

jars in the build path. Earlier jars of old version were being used inspite of new version present.

构建路径中的 jars。尽管存在新版本,但仍在使用旧版本的早期 jars。

回答by Firoz Khan

Right click on the project in Eclipse -> Build Path -> Configure Build Path -> Project Facets -> Uncheck Dynamic Web Module

在 Eclipse 中右键单击项目 -> Build Path -> Configure Build Path -> Project Facets -> 取消勾选 Dynamic Web Module

Note: This approach is good as long you dont plan to run the web-app from within eclipse thru an embedded app server.

注意:只要您不打算通过嵌入式应用程序服务器从 eclipse 中运行 Web 应用程序,这种方法就很好。

回答by rlsport

I was able to update the project Java facet to 1.5 and the errors stopped.

我能够将项目 Java facet 更新到 1.5 并且错误停止了。

回答by brokenboa

I had a similar error using eclipse 4.3 (Kepler), maven 3.1.0, tomcat 6.0.37 and jdk7 (have also jre6 installed), and found a solution to fix it or at least to get rid of the tedious errors by configuring tomcat in eclipse.

我在使用 eclipse 4.3 (Kepler)、maven 3.1.0、tomcat 6.0.37 和 jdk7(也安装了 jre6)时遇到了类似的错误,并找到了一个解决方案来修复它或至少通过配置 tomcat 摆脱繁琐的错误在日食。

In Preferences->Server-> Runtime Environments, define a new run time environment "Apache Tomcat 6.0" and select the jre6 installation from the installed JREs.

在 Preferences->Server->Runtime Environments 中,定义一个新的运行时环境“Apache Tomcat 6.0”并从已安装的 JRE 中选择 jre6 安装。

Then review the Targeted Runtimes in the project's properties. Apache Tomcat v6.0 should be associated with Java Runtime Environment v1.6 (if not yet defined press new and check that the selected JRE is a java 1.6 runtime).

然后查看项目属性中的目标运行时。Apache Tomcat v6.0 应与 Java Runtime Environment v1.6 相关联(如果尚未定义,请按 new 并检查所选 JRE 是否为 java 1.6 运行时)。

Hope it helps

希望能帮助到你

回答by Ashutosh Jindal

For the time being if it's just the annoying Error Message that you want to fix, then as a short-termfix take a look at disabling validation here : Eclipse 'loading descriptor' takes ages

目前,如果它只是您想要修复的烦人的错误消息,那么作为短期修复,请在此处查看禁用验证:Eclipse“加载描述符”需要很长时间

If the above does not work, an alternative would be to use AHK (Autohotkey) which would take slightly more work at your end. (I have been using an AHK script for a couple of years now to get rid of the Eclipse Error popups that I don't care about)

如果上述方法不起作用,另一种方法是使用 AHK(Autohotkey),这将在您的最后花费更多的工作。(我已经使用 AHK 脚本几年来摆脱我不关心的 Eclipse 错误弹出窗口)

Eclipse Bug 198630was raised almost 5 years back and in that there is a commentwhich has an almost identical error message as the OP. (The bug itself was finally closed as not being reproducible).

Eclipse Bug 198630是在大约 5 年前提出的,其中有一条评论与 OP 的错误消息几乎相同。(错误本身最终因不可重现而被关闭)。

I have the following questions for you :

我有以下问题要问你:

  1. Would it be possible for you to show us the Error log ? (To get at the error log you can either take a look at the Error Log View or by looking at the actual file : WORKSPACE_HOME/.metadata/.log. Please take a look at thisfor more detailed information. )
  2. Are you using any specific Server Adapters like WebLogic or Glassfish ?
  1. 您可以向我们展示错误日志吗?(要查看错误日志,您可以查看错误日志视图或查看实际文件 : WORKSPACE_HOME/.metadata/.log。请查看以获取更多详细信息。)
  2. 您是否使用任何特定的服务器适配器,如 WebLogic 或 Glassfish?

I have the following recommendations :

我有以下建议:

  1. In the eclipse bug thread, the problem was fixedat least once by updating to a specific JST version. Hence, would it be possible for you to run an Eclipse update and see whether the problem is resolved ? (This can be done by going to Help -> Check for Updates)

  2. Would it be possible to try importing the project in Eclipse Indigo (instead of Juno, which you currently have) and see whether you can reproduce the problem ? (Eclipse Indigo downloads are available hereand I believe you would need the Java EE version)

  1. 在 eclipse 错误线程中,通过更新到特定的 JST 版本至少修复了一次问题。因此,您是否可以运行 Eclipse 更新并查看问题是否已解决?(这可以通过转到“帮助”->“检查更新”来完成)

  2. 是否可以尝试在 Eclipse Indigo(而不是您目前拥有的 Juno)中导入项目并查看是否可以重现该问题?(此处提供 Eclipse Indigo 下载,我相信您需要Java EE 版本

回答by Fran?ois-Paul Servant

I just got the same symptoms, with a web-app project using maven. In my case, was related to struts taglib tags in web.xml, and the project having a struts v1.2.9 dependency. I solved the problem by switching to struts v1.3.10. Don't ask why this solved the problem.

我刚刚遇到了相同的症状,使用 maven 的网络应用程序项目。就我而言,与 web.xml 中的 struts taglib 标签有关,并且该项目具有 struts v1.2.9 依赖项。我通过切换到 struts v1.3.10 解决了这个问题。不要问为什么这解决了问题。

If you are in the same situation and you upgrade your struts dependency from 1.2.9 to 1.3.10, be sure to use at least dtd v2.3 in the DOCTYPE declaration of your web.xml:

如果您处于相同的情况并且您将 struts 依赖项从 1.2.9 升级到 1.3.10,请确保在 web.xml 的 DOCTYPE 声明中至少使用 dtd v2.3:

!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"

!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"

or you'll get another problem (your webapp won't startup without an internet connection)

否则你会遇到另一个问题(你的 webapp 不会在没有互联网连接的情况下启动)

Hope this helps

希望这可以帮助

回答by Dale

I suspect that the problem is with Eclipse web Tools Platform and Java EMF Model. Here is an image of a list of plugins including Java EMF Model and JEM stuff from Eclipse Web Tools Platform: List of plugins including Java EMF Model and JEM stuff from Eclipse Web Tools Platform

我怀疑问题出在 Eclipse Web 工具平台和 Java EMF 模型上。这是插件列表的图像,包括来自 Eclipse Web 工具平台的 Java EMF 模型和 JEM 内容: 插件列表,包括来自 Eclipse Web 工具平台的 Java EMF 模型和 JEM 内容

https://stackoverflow.com/users/1503535/nitin-gurram, does your stack trace look like this?

https://stackoverflow.com/users/1503535/nitin-gurram,您的堆栈跟踪是这样的吗?

!ENTRY org.eclipse.core.jobs 4 2 2012-09-28 12:10:00.554
!MESSAGE An internal error occurred during: "Loading descriptor for grch97.".
!STACK 0
org.eclipse.emf.ecore.resource.impl.ResourceSetImplDiagnosticWrappedException: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'taglib' not found. (platform:/resource/grch97/WEB-INF/web.xml, 891, 11)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
    at org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl.getResource(ProjectResourceSetImpl.java:1003)
    at org.eclipse.jst.jee.model.internal.JEE5ModelProvider.getModelResource(JEE5ModelProvider.java:169)
    at org.eclipse.jst.jee.model.internal.Web25ModelProvider.getModelObject(Web25ModelProvider.java:44)
    at org.eclipse.jst.jee.model.internal.JEE5ModelProvider.getModelObject(JEE5ModelProvider.java:215)
    at org.eclipse.jst.jee.model.internal.common.AbstractMergedModelProvider.loadProviders(AbstractMergedModelProvider.java:261)
    at org.eclipse.jst.jee.model.internal.common.AbstractMergedModelProvider.access(AbstractMergedModelProvider.java:255)
    at org.eclipse.jst.jee.model.internal.common.AbstractMergedModelProvider$LoadModelsWorkspaceRunnable.run(AbstractMergedModelProvider.java:278)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.jst.jee.model.internal.common.AbstractMergedModelProvider.loadModel(AbstractMergedModelProvider.java:249)
    at org.eclipse.jst.jee.model.internal.common.AbstractMergedModelProvider.getMergedModel(AbstractMergedModelProvider.java:219)
    at org.eclipse.jst.jee.model.internal.common.AbstractMergedModelProvider.getModelObject(AbstractMergedModelProvider.java:139)
    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:54)
Caused by: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'taglib' not found. (platform:/resource/grch97/WEB-INF/web.xml, 891, 11)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.reportUnknownFeature(XMLHandler.java:1985)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleUnknownFeature(XMLHandler.java:1949)
    at org.eclipse.emf.ecore.xmi.impl.XMIHandler.handleUnknownFeature(XMIHandler.java:145)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1893)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1017)
    at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:81)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:995)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:706)
    at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
    at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:240)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1505)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1284)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
    at org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl.demandLoad(ProjectResourceSetImpl.java:811)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
... 14 more