5 Replies Latest reply on Dec 8, 2010 7:19 AM by mareshkau

    Mismatch between namespace and taglib

    rjevans2000

      Hi everyone,

       

      I've recently configured my JSF 2 web app to use RichFaces 4.0 M4. I am also using maven and have configured my pom.xml as described here: http://community.jboss.org/wiki/HowtoaddRichFaces4xtomavenbasedproject. This has been done correctly because I can see the richfaces jars in my maven dependencies folder.

       

      In my xhtml page, I declare the following namespace: xmlns:rich="http://richfaces.org/rich"

       

      My problem is that, if I want to use a richfaces component (such as <rich:colorPicker>) Eclipse complains that "The tag handler class for "rich:colorPicker" (org.richfaces.taglib.ColorPickerTag) was not found on the Java Build Path". Sure enough, when I search for ColorPickerTag it doesn't exist. However, I can see the org.richfaces.taglib package within richfaces-components-ui-4.0.0.20101110-M4.jar (although it contains only 11 classes).

       

      Please tell me what I am doing wrong.

       

      Thanks

        • 1. Re: Mismatch between namespace and taglib
          nbelaevski

          Please show screenshot of dependencies list.

          • 2. Re: Mismatch between namespace and taglib
            rjevans2000

            Hi Nick,

             

            Thanks for taking the time to reply. My pom.xml file is listed below. This results in the following richfaces jars being downloaded:

             

            richfaces-components-ui-4.0.0.20101110-M4.jar

            richfaces-components-api-4.0.0.20101110-M4.jar

            richfaces-core-api-4.0.0.20101110-M4.jar

            richfaces-core-impl-4.0.0.20101110-M4.jar

             

            None of these jars contain the tag files that Eclipse and the compiler complain about (org.richfaces.taglib.CalendarTag for example)

             

            <?xml version="1.0" encoding="UTF-8"?>

            <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/maven-v4_0_0.xsd">

                <modelVersion>4.0.0</modelVersion>

                <groupId>wishlist</groupId>

                <artifactId>wishlist</artifactId>

                <packaging>war</packaging>

                <name>wishlist</name>

                <version>1.0.0-SNAPSHOT</version>

             

                <properties>

                    <!--

                        Explicitly declaring the source encoding eliminates the following

                        message: [WARNING] Using platform encoding (UTF-8 actually) to copy

                        filtered resources, i.e. build is platform dependent!

                    -->

                    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

             

                    <org.springframework.version>3.0.3.RELEASE</org.springframework.version>

                    <org.richfaces.bom.version>4.0.0.20101110-M4</org.richfaces.bom.version>

                    <!--

                        To set the jboss.home environment variable the Maven way, set the

                        jboss.home property in an active profile in the Maven 2 settings.xml

                        file

                    -->

                    <jboss.home>${env.JBOSS_HOME}</jboss.home>

                    <jboss.domain>default</jboss.domain>

                    <!-- The version of Weld extensions in use -->

                    <weld.extensions.version>1.0.0-CR2</weld.extensions.version>

                </properties>

             

                <repositories>

                    <!--

                        Several key Java EE APIs and RIs are missing from the Maven Central

                        Repository

                    -->

                    <!--

                        The goal is to eventually eliminate the reliance on the JBoss

                        repository

                    -->

                    <repository>

                        <id>repository.jboss.org</id>

                        <name>JBoss Repository</name>

                        <url>http://repository.jboss.org/maven2</url>

                    </repository>

                    <repository>

                        <id>jboss-public-repository-group</id>

                        <name>JBoss Public Maven Repository Group</name>

                        <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>

                    </repository>

                </repositories>

             

             

                <!-- BOM IS GETTING IGNORED BY MAVEN??? -->

             

                <dependencyManagement>

             

                    <dependencies>

             

                        <dependency>

             

                            <groupId>org.richfaces</groupId>

             

                            <artifactId>richfaces-bom</artifactId>

             

                            <version>${org.richfaces.bom.version}</version>

             

                            <scope>import</scope>

             

                            <type>pom</type>

             

                        </dependency>

             

                    </dependencies>

             

                </dependencyManagement>

             

                <dependencies>

             

                    <!-- JSF. Version 2.0 includes facelets -->

                    <dependency>

                        <groupId>javax.faces</groupId>

                        <artifactId>jsf-api</artifactId>

                        <version>2.0.0-b21</version>

                    </dependency>

                    <dependency>

                        <groupId>javax.faces</groupId>

                        <artifactId>jsf-impl</artifactId>

                        <version>2.0.0-b21</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.richfaces.ui</groupId>

                        <artifactId>richfaces-components-ui</artifactId>

                    </dependency>

             

             

                    <!-- Scope is provided because the jar bundled with Tomcat is better -->

             

                    <dependency>

             

                        <groupId>javax.servlet</groupId>

             

                        <artifactId>servlet-api</artifactId>

             

                        <version>2.5</version>

             

                        <scope>provided</scope>

             

                    </dependency>

             

                    <dependency>

             

                        <groupId>javax.servlet</groupId>

             

                        <artifactId>jstl</artifactId>

             

                        <version>1.2</version>

             

                    </dependency>

             

                    <dependency>

                        <groupId>junit</groupId>

                        <artifactId>junit</artifactId>

                        <version>4.7</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.apache.commons</groupId>

                        <artifactId>commons-email</artifactId>

                        <version>1.1</version>

                    </dependency>

             

                    <!-- Includes the JPA annotations such as @Entity -->

                    <dependency>

                        <groupId>javax.persistence</groupId>

                        <artifactId>persistence-api</artifactId>

                        <version>1.0</version>

                    </dependency>

             

                    <!-- Hibernate dependencies -->

                    <dependency>

                        <groupId>org.hibernate</groupId>

                        <artifactId>hibernate-core</artifactId>

                        <version>3.3.2.GA</version>

                    </dependency>

                    <dependency>

                        <groupId>org.hibernate</groupId>

                        <artifactId>hibernate-annotations</artifactId>

                        <version>3.4.0.GA</version>

                    </dependency>

                    <dependency>

                        <groupId>org.hibernate</groupId>

                        <artifactId>hibernate-commons-annotations</artifactId>

                        <version>3.3.0.ga</version>

                    </dependency>

                    <dependency>

                        <groupId>org.hibernate</groupId>

                        <artifactId>hibernate-entitymanager</artifactId>

                        <version>3.4.0.GA</version>

                    </dependency>

                    <!-- Bean Validation Implementation -->

                    <!-- Provides portable constraints such as @NotEmpty, @Email and @Url-->

                    <dependency>

                        <groupId>org.hibernate</groupId>

                        <artifactId>hibernate-validator</artifactId>

                        <version>4.0.0.GA</version>

                    </dependency>

                    <!--

                        Common annotations (e.g., @PostConstruct, @PreDestroy, @Generated,

                        @Resource)

                    -->

                    <dependency>

                        <groupId>javax.annotation</groupId>

                        <artifactId>jsr250-api</artifactId>

                        <version>1.0</version>

                    </dependency>

                    <!-- Bean Validation (JSR-303) -->

                    <dependency>

                        <groupId>javax.validation</groupId>

                        <artifactId>validation-api</artifactId>

                        <version>1.0.0.GA</version>

                    </dependency>

             

                    <!--

                        Hibernate uses slf4j for logging, for our purposes here use the

                        simple backend

                    -->

                    <dependency>

                        <groupId>org.slf4j</groupId>

                        <artifactId>slf4j-simple</artifactId>

                        <version>1.5.8</version>

                    </dependency>

             

                    <!-- Required in order to use the MySQL Hibernate dialect -->

                    <dependency>

                        <groupId>mysql</groupId>

                        <artifactId>mysql-connector-java</artifactId>

                        <version>5.1.6</version>

                    </dependency>

             

                    <!--

                        Spring dependencies. All of these are necessary since each one relies

                        on many others

                    -->

                    <dependency>

                        <groupId>org.springframework</groupId>

                        <artifactId>spring-core</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.springframework</groupId>

                        <artifactId>spring-beans</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.springframework</groupId>

                        <artifactId>spring-tx</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.springframework</groupId>

                        <artifactId>spring-orm</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.springframework</groupId>

                        <artifactId>spring-context</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.springframework</groupId>

                        <artifactId>spring-aop</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.springframework</groupId>

                        <artifactId>spring-expression</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.springframework</groupId>

                        <artifactId>spring-web</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

             

                    <dependency>

                        <groupId>org.springframework</groupId>

                        <artifactId>spring-test</artifactId>

                        <version>${org.springframework.version}</version>

                        <scope>test</scope>

                    </dependency>

             

                    <dependency>

                        <groupId>org.springframework.security</groupId>

                        <artifactId>spring-security-web</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

                    <dependency>

                        <groupId>org.springframework.security</groupId>

                        <artifactId>spring-security-config</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

                    <dependency>

                        <groupId>org.springframework.security</groupId>

                        <artifactId>spring-security-taglibs</artifactId>

                        <version>${org.springframework.version}</version>

                    </dependency>

             

             

                </dependencies>

             

                <build>

             

                    <finalName>${artifactId}</finalName>

             

                    <plugins>

             

                        <!-- Compiler plugin enforces Java 1.6 compatiblity -->

             

                        <plugin>

             

                            <groupId>org.apache.maven.plugins</groupId>

             

                            <artifactId>maven-compiler-plugin</artifactId>

             

                            <configuration>

             

                                <source>1.6</source>

             

                                <target>1.6</target>

             

                            </configuration>

             

                        </plugin>

             

                        <!-- Eclipse plugin can force download of source and JavaDoc jars -->

                        <plugin>

                            <groupId>org.apache.maven.plugins</groupId>

                            <artifactId>maven-eclipse-plugin</artifactId>

                            <configuration>

                                <wtpversion>2.0</wtpversion>

                                <!--

                                    <downloadSources>true</downloadSources>

                                    <downloadJavadocs>true</downloadJavadocs>

                                -->

                            </configuration>

                        </plugin>

             

                    </plugins>

                </build>

            </project>

            • 3. Re: Mismatch between namespace and taglib
              nbelaevski

              pom.xml looks good. Strange thing is that while RF 4.x is not supporting JSP (so there should be no CalendarTag and references to such class anywhere in RF) compiler is searching for it. So where this reference is coming from in your case?

              • 4. Re: Mismatch between namespace and taglib
                rjevans2000

                Apologies for the misinformation - there was no compile time problem, it was simply Eclipse highlighting the tag in the xhtml file and complaining that org.richfaces.taglib.CalendarTag couldn't be found. Is there any Eclipse plugin update available that will stop it looking for these redundant tag classes (i'm guessing that it's the JBoss Tools Richfaces plugin that's affected)? I have just started up the server (ignoring Eclipse's warnings) and the calendar component is rendered perfectly.

                 

                Thanks

                • 5. Re: Mismatch between namespace and taglib
                  mareshkau

                  Hi Rory, I have answered about JBoss Tools Update to you here  http://community.jboss.org/message/574859#574859