5

I'm trying to start with Primefaces 2.2.1, but I can't. I have the following definition in pom.xml:

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

<dependency>  
    <groupId>org.primefaces</groupId>  
    <artifactId>primefaces</artifactId>  
    <version>2.2.1</version>  
</dependency> 

But I recevie the following error message:

Warning: This page calls for XML namespace http://primefaces.prime.com.tr/ui declared with prefix p but no taglibrary exists for that namespace.

with this simple code:

<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
        <h:head>
            <title>Facelet Title</title>
        </h:head>
        <h:body>
            Hello from Facelets
            <p:editor />
        </h:body>
</html>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
rancesvinto
  • 61
  • 1
  • 1
  • 4
  • Where and when exactly do you receive this error message? Just in the IDE while you're doing nothing, or only when you run the page in your webbrowser? If in the IDE, what happens when you just run it? – BalusC Sep 28 '11 at 19:10
  • 2
    appears when I access to the page. Finally I solved it adding primefaces.jar to src/main/webapp/WEB-INF/lib/ (I don't know why I have to do it, because maven already added it to target/Eusoma/WEB-INF/lib/) Thanks a lot! – rancesvinto Sep 30 '11 at 12:08
  • 1
    Rancesvinto, please post an answer and mark it accepted. A lot of nitwits who are not reading the PrimeFaces version number and the question date are attempting to answer your question in a wrong way because this problem can also occur when exactly this old taglib URI is been used in a PrimeFaces version newer than 3.0 M4 (which is however *not* the cause of *your* concrete problem). – BalusC Nov 21 '12 at 01:43

6 Answers6

4

Include the tag lib as :

xmlns:p="http://primefaces.org/ui"

And the dependency in pom.xml as :

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

I was also facing the same issue. This solution fixed my problem.

Elmo
  • 6,409
  • 16
  • 72
  • 140
Shikha Dhawan
  • 1,414
  • 8
  • 27
  • 44
  • @Keby: this answer applies since version 3.0 M4 only. The original question handles version 2.2.1 which has a different taglib URI. Also note that the OP already solved the problem as per the comment on the question; it was a Maven issue. – BalusC Nov 21 '12 at 01:38
1

You should have the <repository> between <repositories> :

Try this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.test</groupId>
    <artifactId>jsf_primefaces</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>jsf_primefaces</name>
    <description>JSF PrimeFaces</description>
    <packaging>war</packaging>

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>  
            <groupId>org.primefaces</groupId>  
            <artifactId>primefaces</artifactId>  
            <version>2.2.1</version>  
        </dependency>  

        ......other dependencies.........
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-api</artifactId>
            <version>2.2</version>
        </dependency>

        ......other dependencies.........
    </dependencies>

</project>
ahmet
  • 1,085
  • 2
  • 16
  • 32
0

For me, this was the solution, change the old tag and instead use the following:

xmlns:p="http://primefaces.org/ui"
Abdul Rahman
  • 2,097
  • 4
  • 28
  • 36
Rodrigo
  • 11
  • 1
  • This answer is incorrect for the current question. OP is using PrimeFaces 2.2.1. The new URI change was introduced in 3.0 M4 months later. Note that the OP already solved the problem as per the comment on the question; it was a Maven issue. – BalusC Nov 21 '12 at 01:39
0

Their servers must be down right now because I cannot navigate to their forums either.

They are located in Turkey, I believe so they usually go down for nightly maintenance about this time.

Community
  • 1
  • 1
maple_shaft
  • 10,435
  • 6
  • 46
  • 74
  • Thanks but I'm afraid that's not the issue I have. I have primeface2 2.2.1 in WEB-INF/lib (and today continues not working) I'm using tomcat 7 if it can help – rancesvinto Sep 28 '11 at 10:45
0

If you have been using Eclipse's Export WAR function, you need to explicitly add the dependency into the WAR assembly.

Your answer is here: Eclipse exporting JAR in WAR

Community
  • 1
  • 1
Oh Chin Boon
  • 23,028
  • 51
  • 143
  • 215
-1

Try use xmlns:p="http://primefaces.org/ui"

marioosh
  • 27,328
  • 49
  • 143
  • 192
  • This is introduced in 3.0 M4. The OP is using 2.2 (and already solved the problem; is a Maven issue). – BalusC Dec 02 '11 at 12:44