Alaph432 Alaph432 - 1 month ago 14
Java Question

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.

Answer

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"