Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

netbeans no library found for this namespace

I've searched around but cannot fine a definitive solution. I'm using netbeans+Maven and am trying to upgrade from Primefaces 2.2.1 to 3.0.M3 - when I change the index.xhtml taglib to xmlns:p="http://primefaces.org/ui" netbeans throws the 'no library found for this namespace' error.

The index.xhtml file is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:f="http://java.sun.com/jsf/core"      
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:p="http://primefaces.org/ui" >
<f:view contentType="text/html">
    <h:head>
    </h:head>            
<h:body>
    <h:form>
        <h:commandButton value="Run Test" action="selecttype" />
        <h:commandButton value="Manage Methods" action="addmethod" />
        <h:commandButton value="Manage Data" action="managedata" />
        <p:tagCloud model="#{tagCloudBean.model}" />  
    </h:form>
</h:body>
</f:view>
</html>

So the new taglib and p:tagCloud line are what netbeans says are not working - when I run the program I see the 3 buttons above the message "Warning: This page calls for XML namespace http://primefaces.org/ui declared with prefix p but no taglibrary exists for that namespace.".

For Maven I've updated these parts of the pom.xml:

<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>3.0.M3</version>
</dependency>

<repositories>
    <repository>
        <id>java.net.m2</id>
        <name>java.net m2 repo</name>
        <url>http://download.java.net/maven/2</url>
    </repository>

    <repository>
        <id>prime-repo</id>
        <name>PrimeFaces Maven Repository</name>
        <url>http://repository.primefaces.org</url>
        <layout>default</layout>
     </repository>
</repositories>

and commented out the old prime-repo repository info.

I have got primefaces-3.0.M3.jar as a local dependency - this seems to be ok as all java class files using the library are referencing it ok. The primefaces-3.0.M3.jar binary is also in my WEB-INF/lin folder. I've seen a lot of people having weird issues with netbeans and am not sure if I'm simply missing something or if its the IDE. Any ideas would be greatly appreciated.

like image 818
Alaph432 Avatar asked Sep 21 '11 09:09

Alaph432


3 Answers

Actually if you are using Primefaces 3.0 M4 then the xmlns changed to:

xmlns:p="http://primefaces.org/ui"
like image 75
Stoto Avatar answered Sep 18 '22 21:09

Stoto


This is the solution:

  1. Right click on the EE project.
  2. Click on Frameworks.
  3. Click on JavaServer Faces.
  4. Click on Components
  5. Check PrimeFaces
  6. Click OK

This solves the problem. However, the error icon will still appear in the left panel of our project. (Not in the code). So you must copy all your code (whatever) .xhtml and recreate it, paste the code you wrote and run.

In other words, you must recreate the file that is giving you problems.

like image 22
David Escobar Avatar answered Sep 17 '22 21:09

David Escobar


The xmlns is wrong for the Primefaces component. Try changing the url to http://primefaces.prime.com.tr/ui as per the Primefaces Getting Started guide.

UPDATE 08-08-2013:

As of this moment the correct namespace as listed in the following link is:

xmlns:p="http://primefaces.org/ui"
like image 26
maple_shaft Avatar answered Sep 21 '22 21:09

maple_shaft