This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 172520 - [68cat] Custom Facelets taglibs not found
Summary: [68cat] Custom Facelets taglibs not found
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 10 votes (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-17 20:18 UTC by jpleed3
Modified: 2018-06-04 12:16 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
custom tablib not found by netbeans (113.52 KB, image/png)
2009-10-23 17:59 UTC, mjreged
Details
Test Web Project (24.66 KB, application/x-compressed)
2009-10-24 19:11 UTC, jpleed3
Details
Project changed - tags attributes auto-complete not working (26.26 KB, application/zip)
2010-02-11 04:45 UTC, jordanorc
Details
project demonstrating problems with custom facelets, seam libraries and jstl tags. (209.47 KB, application/zip)
2010-06-01 12:37 UTC, razvan.petruescu
Details
Project demonstrating problems with custom facelets, seam libraries and jstl tags (5.20 MB, application/zip)
2010-06-09 12:08 UTC, razvan.petruescu
Details
screenshot proving problems still exist (299.64 KB, image/jpeg)
2010-06-11 11:19 UTC, razvan.petruescu
Details
No library found with this namespace, but the page works. (199.12 KB, image/png)
2010-06-18 19:55 UTC, mertins
Details
Project Maven with custom component JSF 2.0 and a Web project that use it. (11.72 KB, application/zip)
2010-06-18 20:07 UTC, mertins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jpleed3 2009-09-17 20:18:30 UTC
I have a few custom taglibs designed for (and that work with) Facelets 1.1.14 included as a jar into webapps. I have 
the foo.taglib.xml files in the META-INF folder of the included library and each XML file starts with something 
similar to:

<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" id="th">
    <namespace>/tags/core</namespace>

In the Facelets pages, not only does autocomplete not recognize the functions or tags, the namespace declarations have 
an error: "No library found for this namespace".

According to the JSF 2 spec section 10.3.2, this is a standard feature.
Comment 1 Marek Fukala 2009-10-22 12:48:52 UTC
Sure, this is supposed to work and it works for me. Can you please attach a simple project showing the issue? I am also
not sure if the pre 2.0 faceles configs cannot be the problem...
Comment 2 mjreged 2009-10-23 17:56:18 UTC
Our project also has the same problem.
we placed q2i.taglib.xml in our WEB-INF/taglib folder
and declared the namespace like this :

<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC
  "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
  "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">

<facelet-taglib>
    <namespace>http://www.bipt.com/jsf</namespace>


Then in our web.xml we have
<context-param>
        <param-name>facelets.LIBRARIES</param-name>
        <param-value>
            /WEB-INF/taglib/q2i.taglib.xml
        </param-value>
</context-param>


Netbeans 6.8 does not find the the taglib file and complains that
No library found for this namespace

See attached screenshot.



Comment 3 mjreged 2009-10-23 17:59:13 UTC
Created attachment 89997 [details]
custom tablib not found by netbeans
Comment 4 jpleed3 2009-10-24 19:11:05 UTC
Created attachment 90051 [details]
Test Web Project
Comment 5 jpleed3 2009-10-24 19:12:36 UTC
Unzip and give that project a try. It works fine for me with v3, but neither the tags nor the library is recognized in 
build 200910170201.
Comment 6 bleathem 2009-12-04 12:25:04 UTC
Why is this marked resolved?  I just downloaded 6.8 RC 2, and I'm still getting this error.  The "No library found for this namespace" is still displayed, and all tags that use this namespace are underlined in red.

In some cases more than half of my facelet files are underlined in red.  This makes it difficult to spot an actual "real" error when editing the files.

Given that this syntax was supported in Netbeans 6.7, and is valid for Java EE 5 / facelets projects, can the old taglib mechanism not be supported in Netbeans 6.8?

(I'm re-opening this issue, but I'm not sure if that is something I'm supposed to do, please advise.  I apologize in advance)

Thanks,
Brian Leathem
Comment 7 jordanorc 2010-02-09 12:51:46 UTC
Anyone know if this is forecast to resolve this bug?

I'm having the same problem here!

This is a know old problem.

Thank's

Celestrini
Comment 8 Marek Fukala 2010-02-09 16:14:44 UTC
(In reply to comment #7)
> Anyone know if this is forecast to resolve this bug?
> 
> I'm having the same problem here!
> 
> This is a know old problem.
> 
> Thank's
> 
> Celestrini

Please attach here a reporducible usecase, eg. a project which with all necessary files where the editing support fails + describe the steps to reproduce.

As for the project attached by  jpleed3  on 2009-10-24 19:11:05 - the index.xhtml file contains some references to tag files which are not part of the project. How can I use it to reproduce?
Comment 9 jpleed3 2010-02-09 18:44:43 UTC
> As for the project attached by  jpleed3  on 2009-10-24 19:11:05 - the
> index.xhtml file contains some references to tag files which are not part of
> the project. How can I use it to reproduce?

Where are the references to a tag file that isn't in the project? There are two custom tags listed in META-INF/test.taglib.xml. One is a xhtml component in the test/taglib/test1.xhtml file; the other is a custom handler in test.taglib.Test2Handler.java.

Like I said, the project runs fine but the editor doesn't pick up the tags. Would you prefer a Maven project instead?
Comment 10 Marek Fukala 2010-02-10 00:24:13 UTC
Ohh, I'm sorry, I was tired out in the evening. The resources are in source packages, not in the web root, I see.
Comment 11 Marek Fukala 2010-02-10 01:18:46 UTC
fixed in web-main#6b2adfc1ecd9
Comment 12 jpleed3 2010-02-10 08:03:47 UTC
Yeah, I made that project before I went to Maven. The taglibs in my real code are in the resources folder now. :)
Comment 13 Quality Engineering 2010-02-10 21:22:03 UTC
Integrated into 'main-golden', will be available in build *201002110200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6b2adfc1ecd9
User: Marek Fukala <mfukala@netbeans.org>
Log: #172520 -  [68cat] Custom Facelets taglibs not found
Comment 14 jordanorc 2010-02-11 04:45:45 UTC
Created attachment 94075 [details]
Project changed - tags attributes auto-complete not working

Hey guys...

It's working now!

But I'm having some problems yet!

Despite Netbeans recognize the Namespace of library and the components, I'm not able to auto-complete the tags attributes.

I'm using the project attached by jpleed3 and I put in test.taglib.xml:

<tag>
	<tag-name>test2</tag-name>
	<handler-class>test.taglib.Test2Handler</handler-class>
	<attribute>
		<name>rendered</name>
		<required>true</required>
	</attribute>
</tag>

But Netbeans not recognize the atributes.

Another problem: when I have components with source, like:

<tag>
	<tag-name>test1</tag-name>
	<source>resources/test/test1.xhtml</source>
</tag>

I expect that Netbeans read the content of file and get the tag attributes from:

<cc:attribute name="teste" />

But It's not happening.

I have to create a .tld? It would be much simpler if Netbeans could reader the taglib or the source and get the attributes.

I'm attaching the project... changed.

Thnk's and I'm sorry about my English.. hehe!

Ahhh... I really need to restart my IDE to Netbeans recovery changes in taglib.xml????
Comment 15 Marek Fukala 2010-02-11 11:15:20 UTC
All the problems described by jordanorc are reproducible. I'll fix it ASAP.
Comment 16 Marek Fukala 2010-02-12 03:34:14 UTC
changeset:   159688:0caaf6c6a1b1
date:        Fri Feb 12 11:26:58 2010 +0100
summary:     #172520 - A) Composite component libraries are recognized when put into the project's source folder underneath META-INF.*/resources; B) Tags declared in facelets descriptors (*.taglib.xml) residing in project's sources META-INF.* folder are recognized

There are still two remaining problems (I'm still working on them):
1) The metadata from ${project's sources folder}/META-INF/*.taglib.xml are not fully taken into account - the attributes description is ommited (this is because I just use the Mojarra's parser to get the metadata from it and the parser does't care about them)

2) The tags declared in following way:

<tag>
    <tag-name>test1</tag-name>
    <source>resources/test/test1.xhtml</source>
</tag>

are not recognized (but only if the refered source is not in META-INF*/resources/alibfolder/ folder - then it is recognized as a composite component library member and is accessible using the default cc namespace + the lib name.
Comment 17 jordanorc 2010-02-12 03:43:31 UTC
Hey man!

Good job!

When you finish, please, send-me message with the build with changes and I will test it again!

Thank's,

Congratulations Netbeans Team! Very good work!
Comment 18 Quality Engineering 2010-02-12 21:43:15 UTC
Integrated into 'main-golden', will be available in build *201002130200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0caaf6c6a1b1
User: Marek Fukala <mfukala@netbeans.org>
Log: #172520 - A) Composite component libraries are recognized when put into the project's source folder underneath META-INF.*/resources; B) Tags declared in facelets descriptors (*.taglib.xml) residing in project's sources META-INF.* folder are recognized
Comment 19 Marek Fukala 2010-02-15 07:15:01 UTC
changeset:   160198:36dd6ae68dc2
date:        Mon Feb 15 15:10:31 2010 +0100
summary:     #172520 - metadata from tag library descriptors residing in project's sources are taken into account; Unified and fixed tags' completion help

item #1 from comment #16 fixed

I also realized that the item #2 from the same comment is quite misleading. The library descriptor is already parsed and the declared tag is visible in the code completion together with its description (if available in the taglib descriptor file). If the refered file is a composite component, then all the features works fine. If not - what would the completion offer? I'd say nothing ... so I consider this usecase as functional.

So it looks like the last complain is:
>Ahhh... I really need to restart my IDE to Netbeans recovery changes in
>taglib.xml????
Comment 20 Marek Fukala 2010-02-15 09:27:25 UTC
changeset:   160210:fd805c6f020c
tag:         tip
user:        Marek Fukala <mfukala@netbeans.org>
date:        Mon Feb 15 17:20:31 2010 +0100
summary:     #172520 - facelet library is refreshed upon its file change

Please test the changes and reopen or preferably create new issue if you find the fix is not correct or introduces some regressions.

The last change is kind quite hacky since all facelets libraries are invalidated after you modify any of its descriptors. I've filed a separate issue for this problem ( Bug 180739 -  All facelets libraries are invalidated upon modification of any of its descriptors )

I'm looking forward for your feedback (and bugs :-) ).
Comment 21 Quality Engineering 2010-02-16 21:51:47 UTC
Integrated into 'main-golden', will be available in build *201002170200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/36dd6ae68dc2
User: Marek Fukala <mfukala@netbeans.org>
Log: #172520 - metadata from tag library descriptors residing in project's sources are taken into account; Unified and fixed tags' completion help
Comment 22 jpleed3 2010-03-17 15:17:01 UTC
And here we are again. :)

6.9 is detecting my Richfaces libraries now, which is a big help. However, the custom taglibs are still not recognized.

Also, in the taglib test I attached, on lines 11 and 13 of index.xhtml, the rendered attribute is flagged as an error, saying "The attribute rendered is not defined in the component's interface"

The component doesn't have an interface since one can't exactly be defined for it. In that case, I don't think it should be shown as an error. If anything is shown, it should be a warning at most.
Comment 23 razvan.petruescu 2010-05-31 07:36:46 UTC
Hi, I'm using 6.9 RC and I see this problem has not been solved yet. I'm currently lobbying for the acceptance of NB in my company, but it is an useless effort so far because a lot of projects we have are based on custom JSF facelets. Also the same problem with seam specific tags, like <s:defaultAction/>, <s:validate/>, <s:span/>. They are not recognized and auto completion still doesn't work. Please tell me, do I need to file this complaint somewhere else, maybe to open a new bug report, or does this suffice?
Comment 24 razvan.petruescu 2010-05-31 07:40:34 UTC
Forgot to say, thanks a lot for the great effort, NB looks promising. Sorry if I seem blunt, I'm not, just try to give as accurate as possible feedback.
Comment 25 Marek Fukala 2010-05-31 08:22:20 UTC
Razvan, the best is if the issue has increased priority. If this is a blocker for anyone it needs to be fixed in preference to other issues.

I made the issue a P2 and will look at it asap. I may possibly need some input from you later.

Thanks for the feedback.
Comment 26 razvan.petruescu 2010-05-31 09:40:45 UTC
(In reply to comment #25)
> Razvan, the best is if the issue has increased priority. If this is a blocker
> for anyone it needs to be fixed in preference to other issues.
> 
> I made the issue a P2 and will look at it asap. I may possibly need some input
> from you later.
> 
> Thanks for the feedback.

No problem, please contact me if you need additional feedback.
Comment 27 Marek Fukala 2010-06-01 11:39:48 UTC
> Also, in the taglib test I attached, on lines 11 and 13 of index.xhtml, the
> rendered attribute is flagged as an error, saying "The attribute rendered is
> not defined in the component's interface"
> 
> The component doesn't have an interface since one can't exactly be defined for
> it. In that case, I don't think it should be shown as an error. If anything is
> shown, it should be a warning at most.

That is the only remaining problem I found in going through this long issue and I'll try to fix it.

Razvan, as for the seam's taglibs, I cannot reproduce the issue. If I add all the seam's 2.2.0GA jars to the project classpath the JSF support works fine and I can see the <s:defaultAction/> and the others in the completion together with their attributes.

Would it be a big problem for you to create a sample project which I could use to reproduce the bugs you are facing? Or at least try to exactly describe what doesn't work in what environment.
Comment 28 razvan.petruescu 2010-06-01 11:46:00 UTC
Hi Marek, 

I will try to assemble a 'dummy' project to reproduce the environment asap and I will attach it here.
Forgot to mention, I'm also facing problems with jstl tags like <c:if>.
And, it will be a Maven project, I also forgot to mention that.

Regards.
Comment 29 razvan.petruescu 2010-06-01 12:37:54 UTC
Created attachment 99710 [details]
project demonstrating problems with custom facelets, seam libraries and jstl tags.
Comment 30 razvan.petruescu 2010-06-01 12:40:12 UTC
Hi Marek,

I attached a project, hope it's going to be of help. It's part of a larger maven project, just point netbeans to open pom.xml and should open it...don't know about the dependencies though. Please let me know if I can provide additional help.
Some files where to look for problems:
propertyType.xhtml
entityList.xhtml (this is a custom facelet, the taglib is located inside the WEB-INF/facelets/tags/up.taglib.xml)

Problems with::
-seam tags
-custom facelets
-jstl tags

Thanks a lot again, 
Razvan.
Comment 31 Marek Fukala 2010-06-01 13:38:38 UTC
Thanks, I can reproduce the problem with tags from up.taglib.xml not being recognized. Its caused by the fact that the deployment descriptor (web.xml) is not found and thus the refererence to the library is not taken into account. I'll look at this if I can somehow resolve it.

As for the richfaces and jstl tags I cannot reproduce since the project's pom.xml refers to some parent pom which likely declares these libraries.
Comment 32 razvan.petruescu 2010-06-01 14:07:12 UTC
All right, seems we're getting there...:)
Thanks for feedback.
As about the other problems, if necessary I'll try to send the project with the parent pom too, in order to be able to replicate. 
What do you think?

Razvan.
Comment 33 Marek Fukala 2010-06-02 10:35:09 UTC
Razvan, would it be possible to create a valid netbeans project with the reproducible case? If I open the one sent by you the project is marked as invalid and I suspect that the fact that the web.xml is not found is caused by that. Or sent me the project this one depends on (the link to the parent pom).
Comment 34 razvan.petruescu 2010-06-02 11:17:49 UTC
Hi Marek, 

I'll try to send you what you requested tonight, unfortunately I cannot do it right now.
Comment 35 Marek Fukala 2010-06-02 12:55:02 UTC
OK. Thanks. I do not think this is a showstopper (P1 issue) so it won't be likely added to the 6.9FCS, but I would like to see the fix in 6.9.1 which should follow very soon.
Comment 36 razvan.petruescu 2010-06-02 13:50:34 UTC
Perfect, it's no rush I guess, since you guys already have a lot of stuff to fix, preparing for the great 6.9 release!
We would like to see it fixed though, so I'm gonna try to prepare a good project to reproduce the problem.

Thanks again,
Razvan.
Comment 37 razvan.petruescu 2010-06-09 12:08:09 UTC
Created attachment 99936 [details]
Project demonstrating problems with custom facelets, seam libraries and jstl tags

Hi Marek, 

Sorry for being late with this.
Fortunately I found a much simpler solution, namely a seam demo project, with some files that already contain seam tags.
I just added some jstl tags, custom tags and our up.taglib.xml, and problems should be reproducible.


To sum up::

===========================================================================
Environment::
NetBeans 6.9 RC2
===========================================================================
Problems::
* NetBeans reports "No library found for this namespace" when encountering
the namespaces associated with jstl and seam libraries, 
and a custom namespace.
* the tags themselves are underlined with red.
===========================================================================
Note that you have to add the JEE 6 and JSTL library dependencies(I did not 
bundle them to keep the size of the archive low). The seam 
jar is already bundled. 

Thanks, 
Razvan.
Comment 38 Marek Fukala 2010-06-10 14:47:31 UTC
Razvan, thanks for the sample project. As for the issues here are my comments:

1) the custom facelets library declared in up.taglib.xml was not found since the links are relative to the parent folder of the web-inf folder, not the web module root. I've changed the code so both roots are used when trying to resolve the link, web-inf's parent first. (web-main#804893b9db9c)

2) as for the default jstl tags, I believe the JSF2.0 namespace for them is http://java.sun.com/jsp/jstl/core not http://java.sun.com/jstl/core, if you change the references it works fine

3) as for the seam tags, you need jboss-seam-ui.jar which contains the facelets library descriptor on the project's classpath otherwise netbeans cannot find the library description.

I'm looking forward on your opinions on my issue resolution. I assume it being reopened at once ;-). 

Thank you for the feedback.
Comment 39 Quality Engineering 2010-06-11 06:53:07 UTC
Integrated into 'main-golden', will be available in build *201006110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/804893b9db9c
User: Marek Fukala <mfukala@netbeans.org>
Log: #172520 - [68cat] Custom Facelets taglibs not found
Comment 40 razvan.petruescu 2010-06-11 11:19:05 UTC
Created attachment 100011 [details]
screenshot proving problems still exist

Hi Marek again,

And thank you for the feedback too.
As for my comments, here they are::

1. The fix with regards to the custom facelets library has no effect. If you look at the attached picture, you see that the up:secureForm tag is still underlined.
As you see, I tried using the 201006110001 nightly build.

2. Please have a look here:
http://wiki.java.net/bin/view/Projects/FaceletsFAQ#What_s_the_difference_between_c
The answer to the last question clearly states that "Facelets expects the namespace of its subset of JSTL to be http://java.sun.com/jstl/core and NOT http://java.sun.com/jsp/jstl/core as defined by JSTL 1.1.", exactly the opposite of what you mentioned. So is has to work using that namespace.

3. Please read further. 

Anyway, getting back to the basics, we have a maven project, so the differences may lie there, definitely I'll have to find a way to thoroughly reproduce our environment. I'll work on this and when it's ready I'll attach the project.
So what do you say, is it reopened?
Comment 41 mertins 2010-06-18 19:55:14 UTC
Created attachment 100227 [details]
No library found with this namespace, but the page works.
Comment 42 mertins 2010-06-18 20:07:23 UTC
Created attachment 100228 [details]
Project Maven with custom component JSF 2.0 and a Web project that use it.

Hi, I have the same problem (or I think that) in Netbeans 6.9 (build 201006130001).

I use custom JSF components, Maven and Netbeans.

I make a litle Maven project with the problem. The page index.jsf work with my simple custom jsf component, but Netbeans's editor don't find the xmlns (see screenshot that I sent before please).

I think that netbeans will need to looking for files.taglib.xml to resolve this kind of problem, but I didn't know how.

I hope that the test project help

Best regards
Comment 43 werpu 2010-09-30 13:02:10 UTC
Hello I can reproduce the bug, but only in one certain configuration. Namely if you have a jsf maven project and import it into Netbeans then I am getting this error. In a Netbeans generated project this functionality works out of the box. I assume there is one check too much there, especially since Facelets now is bundled within the JSF impl.
It does not matter which JSF implementation you have in maven either myfaces or mojarra, in both cases the error is issued instead of the template being generated. Reproducable in 6.9 and 6.9.1.
Comment 44 Marek Fukala 2010-12-27 15:56:25 UTC
there's some progress on this problem resolution, but not done completely yet.

web-main#1b49a881c8fe
Comment 45 Marek Fukala 2010-12-28 14:35:17 UTC
fixed in web-main#f6b333570807
Comment 46 Quality Engineering 2010-12-29 07:05:13 UTC
Integrated into 'main-golden', will be available in build *201012290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/1b49a881c8fe
User: Marek Fukala <mfukala@netbeans.org>
Log: some progress at issue #177540 - JSF support doesn't index project dependencies properly, #172520 - [68cat] Custom Facelets taglibs not found. Also added unit tests for JSF libraries, indexing. Also fixed bugs with default library prefixes, improved performance by using more index data instead of another files scanning.
Comment 47 GeraldoLuiz 2011-03-15 14:24:01 UTC
I reopened it because I'm still having the issue pointed out by jpleed3 on comment #22:

"Also, in the taglib test I attached, on lines 11 and 13 of index.xhtml, the
rendered attribute is flagged as an error, saying "The attribute rendered is
not defined in the component's interface"
The component doesn't have an interface since one can't exactly be defined for
it. In that case, I don't think it should be shown as an error. If anything is
shown, it should be a warning at most."

Marek Fukala replied in post #27:
"That is the only remaining problem I found in going through this long issue and
I'll try to fix it."

I'm using versions 6.9.1 and 7.0.beta2 and the problem is still there. The only attribute NetBeans identifies is "id" when you use ctrl-space (code assistant) in the custom tag. Despite of being flagged as error by NetBeans, the value of the attribute is passed to the component at runtime and it works fine, but the error flagging in this case can confuse the user.

I'm not sure if I should reopen this entry or file another one.
Comment 48 Marek Fukala 2011-03-15 15:24:53 UTC
If you wouldn't mind I'd prefer a new issue with clear steps to reproduce and possibly a sample project. This issue is a bit hard to orient in. Thanks for understanding and your time.
Comment 49 ddqod 2018-06-04 12:16:03 UTC
Hi there, I ran into a similar issue. I'm creating a JSF 2.2 custom componentes to be used among different projects.

My issue was the wrongly defined namespace and replaced by

<facelet-taglib version="2.2"
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facelettaglibrary_2_2.xsd">
</facelet-taglib>


Source: https://jsflive.wordpress.com/2013/05/16/jsf22-namespaces/