javaeclipsejsptaglibcustom-tags

Eclipse "cannot find the tag library descriptor" for custom tags (not JSTL!)


I have a Java EE project which build fine with Ant, deploys perfectly to JBoss, and runs without any trouble. This project includes a few custom tag libraries (which is not JSTL!), which are also working without any difficulties.

The problem is with the Eclipse IDE (Ganymede): in every single JSP file which uses our custom tags, the JSP parser flags the taglib include line with with this error:

Cannot find the tag library descriptor for (example).tld

This also causes every use of the tab library to be flagged as an error, and since the IDE doesn't have their definition, it can't check tag parameters, etc.

Our perfectly-working JSP files are a sea of red errors, and my eyes are beginning to burn.

How can I simply tell Eclipse, "The tag library descriptor you are looking for is "src/web/WEB-INF/(example)-taglib/(example).tld"?

I've already asked this question on the Eclipse support forums, with no helpful results.


Solution

  • It turns out that the cause was that this project wasn't being considered by Eclipse to actually be a Java EE project at all; it was an old project from 3.1, and the Eclipse 3.5 we are using now requires several "natures" to be set in the project configuration file.

    <natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>InCode.inCodeNature</nature>
        <nature>org.eclipse.dltk.javascript.core.nature</nature>
        <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
        <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
        <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
        <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
    </natures>
    

    I was able to find the cause by creating a new "Dynamic Web Project" which properly read its JSP files, and diffing against the config of the older project.

    The only way I could find to add these was by editing the .project file, but after re-opening the project, everything magically worked. The settings referenced by pribeiro, above, weren't necessary since the project already conformed to the default settings.

    Both pribeiro and nitind's answers gave me ideas to jumpstart my search, thanks.

    Is there a way of editing these "natures" from within the UI?