Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse FeatureNotFoundException

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

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

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).

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

<!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>
like image 808
RaceBase Avatar asked Aug 06 '12 08:08

RaceBase


3 Answers

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

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

if the web.xml says:

<!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..

like image 126
Henrik Avatar answered Nov 13 '22 05:11

Henrik


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

web.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-app element

<web-app>

then update the maven project (ALT+F5).

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

like image 28
A4L Avatar answered Nov 13 '22 03:11

A4L


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

<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.

<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.

like image 4
CodeMonkey Avatar answered Nov 13 '22 04:11

CodeMonkey