You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Peter Penzov <pe...@gmail.com> on 2012/06/04 21:21:09 UTC

Cannot use PrimeFaces in OSGI bundle

Hi,
   I have a WAR package with OSGI plugin. The package is deployed as OSGI
bundle in Glassfish and it's working. I have a very strange problem with
the POM file of the bundle: when I added Primefaces I get this error into
the JSF page:

Warning: This page calls for xml namespace
http://primefaces.org/uideclared with prefix p but no taglibtrary
exist for that namespace

The problem is in these lines:

<build>
    <pluginManagement>

        <plugins>
               <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.1.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <supportedProjectTypes>
                            <supportedProjectType>ejb</supportedProjectType>
                            <supportedProjectType>war</supportedProjectType>

<supportedProjectType>bundle</supportedProjectType>
                            <supportedProjectType>jar</supportedProjectType>
                        </supportedProjectTypes>
                        <instructions>
                            <!-- Read all OSGi configuration info from this
optional file -->
                            <_include>-osgi.properties</_include>
                            <!-- By default, we don't export anything -->
                            <Export-Package>!*.impl.*, *</Export-Package>
                        </instructions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>bundle-manifest</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>manifest</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>bundle-install</id>
                            <phase>install</phase>
                            <goals>
                                <goal>install</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

             <plugin> <!-- Need to use this plugin to build war files -->
                    <artifactId>maven-war-plugin</artifactId>
                    <groupId>org.apache.maven.plugins</groupId>
                    <!-- Use version 2.1-beta-1, as it supports the new
property failOnMissingWebXml -->
                    <version>2.1-beta-1</version>
                    <configuration>
                        <archive>
                            <!-- add bundle plugin generated manifest to
the war -->
                            <manifestFile>

${project.build.outputDirectory}/META-INF/MANIFEST.MF
                            </manifestFile>
                            <!-- For some reason, adding Bundle-ClassPath
in maven-bundle-plugin
                            confuses that plugin and it generates wrong
Import-Package, etc.
                            So, we generate it here.
                            -->
                            <manifestEntries>
                                <Bundle-ClassPath>WEB-INF/classes/
                                </Bundle-ClassPath>
                            </manifestEntries>
                        </archive>
                    <!-- We don't have a web.xml -->
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                    </configuration>
                </plugin>
              </plugins>
        </pluginManagement>
         <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>

<outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>

<artifactId>javaee-endorsed-api</artifactId>
                                    <version>6.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <!-- Enable this plugin for all modules -->
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

Something is preventing the loading of the Primefaces jar but I cannot find
what.
If I remove these lines Primefaces are working normally. Can you help me to
find the problem?

Best wishes
Peter

Re: Cannot use PrimeFaces in OSGI bundle

Posted by Felix Meschberger <fm...@adobe.com>.
Hi,

Sorry, I am out of ideas ... I don't know enough about this use case.

Regards
Felix

Am 05.06.2012 um 17:51 schrieb rcbandit:

> I removed it from the the POM file:
> 
> 
> 
> <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.DX_57</groupId>
>    <artifactId>History-Module-57</artifactId>
>    <version>1.0-SNAPSHOT</version>
>    <packaging>war</packaging>
>    <name>History-Module-57</name>
>    <properties>
>        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>    </properties>
>    <dependencies>
>        <dependency>
>            <groupId>org.primefaces</groupId>
>            <artifactId>primefaces</artifactId>
>            <version>3.3</version>
>            <type>jar</type>
>        </dependency>
>        <dependency>
>            <groupId>javax</groupId>
>            <artifactId>javaee-web-api</artifactId>
>            <version>6.0</version>
>            <scope>provided</scope>
>        </dependency>
>        <dependency>
>            <groupId>junit</groupId>
>            <artifactId>junit</artifactId>
>            <version>4.8.2</version>
>            <scope>test</scope>
>        </dependency>        
>        <dependency>
>            <groupId>org.osgi</groupId>
>            <artifactId>org.osgi.core</artifactId>
>            <version>4.2.0</version>
>            <scope>provided</scope>
>        </dependency>
>        <dependency>
>            <groupId>org.osgi</groupId>
>            <artifactId>org.osgi.compendium</artifactId>
>            <version>4.2.0</version>
>            <scope>provided</scope>
>        </dependency>
>        <dependency>
>            <groupId>org.glassfish</groupId>
>            <artifactId>osgi-cdi-api</artifactId>
>            <version>3.1-b41</version>
>            <type>jar</type>
>            <scope>provided</scope>
>        </dependency>
>    </dependencies>
>    <build>
>        <pluginManagement>           
>            <plugins>
>                <plugin>
>                    <groupId>org.apache.felix</groupId>
>                    <artifactId>maven-bundle-plugin</artifactId>
>                    <version>2.1.0</version>
>                    <extensions>true</extensions>
>                    <configuration>
>                        <supportedProjectTypes>
>                            <supportedProjectType>ejb</supportedProjectType>
>                            <supportedProjectType>war</supportedProjectType>
> 
> <supportedProjectType>bundle</supportedProjectType>
>                            <supportedProjectType>jar</supportedProjectType>
>                        </supportedProjectTypes>
>                        <instructions>
> 
>                            <_include>-osgi.properties</_include>
> 
>                            <Export-Package>*</Export-Package>
>                        </instructions>
>                    </configuration>
>                    <executions>
>                        <execution>
>                            <id>bundle-manifest</id>
>                            <phase>process-classes</phase>
>                            <goals>
>                                <goal>manifest</goal>
>                            </goals>
>                        </execution>
>                        <execution>
>                            <id>bundle-install</id>
>                            <phase>install</phase>
>                            <goals>
>                                <goal>install</goal>
>                            </goals>
>                        </execution>
>                    </executions>
>                </plugin> 
> 
>                <plugin> 
>                    <artifactId>maven-war-plugin</artifactId>
>                    <groupId>org.apache.maven.plugins</groupId>
> 
>                    <version>2.2</version>
>                    <configuration>
>                        <archive>
> 
>                            <manifestFile>
> 
> ${project.build.outputDirectory}/META-INF/MANIFEST.MF
>                            </manifestFile>
> 
>                            <manifestEntries>
>                                <Bundle-ClassPath>WEB-INF/classes/
>                                </Bundle-ClassPath>
>                            </manifestEntries>
>                        </archive>
> 
>                        <failOnMissingWebXml>false</failOnMissingWebXml>
>                    </configuration>
>                </plugin>
>            </plugins>
>        </pluginManagement>
>        <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-dependency-plugin</artifactId>
>                <version>2.1</version>
>                <executions>
>                 //removed the plugin here  
>                </executions>
>            </plugin>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-compiler-plugin</artifactId>
>                <version>2.3.2</version>
>                <configuration>
>                    <source>1.7</source>
>                    <target>1.7</target>
>                    <compilerArguments>
>                        <endorseddirs>${endorsed.dir}</endorseddirs>
>                    </compilerArguments>
>                </configuration>
>            </plugin>
>            <plugin>
> 
>                <groupId>org.apache.felix</groupId>
>                <artifactId>maven-bundle-plugin</artifactId>
>            </plugin>
>        </plugins>
>    </build>
>    <repositories>
>        <repository>
>            <id>glassfish-repo</id>
>            <name>The Glassfish repository</name>
>            <url>http://download.java.net/maven/glassfish/</url>
>        </repository>
>        <repository>  
>            <id>prime-repo</id>  
>            <name>PrimeFaces Maven Repository</name>  
>            <url>http://repository.primefaces.org</url>  
>            <layout>default</layout>  
>        </repository>  
>    </repositories>
>    <description>Module History Module</description>
> </project>
> 
> The configuration of the POM file is preventing Primefaces to work. If
> replace the <build> section with simple WAR build configuration it will
> work.
> Do you find something unusual into this configuration that may cause the
> problem?
> 
> Best wishes
> Peter
> 
> 
> --
> View this message in context: http://apache-felix.18485.n6.nabble.com/Cannot-use-PrimeFaces-in-OSGI-bundle-tp4997874p4997901.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Cannot use PrimeFaces in OSGI bundle

Posted by rcbandit <pe...@gmail.com>.
I removed it from the the POM file:



<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.DX_57</groupId>
    <artifactId>History-Module-57</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>History-Module-57</name>
    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>3.3</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>        
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <version>4.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>osgi-cdi-api</artifactId>
            <version>3.1-b41</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <pluginManagement>           
            <plugins>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.1.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <supportedProjectTypes>
                            <supportedProjectType>ejb</supportedProjectType>
                            <supportedProjectType>war</supportedProjectType>
                           
<supportedProjectType>bundle</supportedProjectType>
                            <supportedProjectType>jar</supportedProjectType>
                        </supportedProjectTypes>
                        <instructions>
                            
                            <_include>-osgi.properties</_include>
                            
                            <Export-Package>*</Export-Package>
                        </instructions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>bundle-manifest</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>manifest</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>bundle-install</id>
                            <phase>install</phase>
                            <goals>
                                <goal>install</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin> 
           
                <plugin> 
                    <artifactId>maven-war-plugin</artifactId>
                    <groupId>org.apache.maven.plugins</groupId>
                    
                    <version>2.2</version>
                    <configuration>
                        <archive>
                            
                            <manifestFile>
                               
${project.build.outputDirectory}/META-INF/MANIFEST.MF
                            </manifestFile>
                            
                            <manifestEntries>
                                <Bundle-ClassPath>WEB-INF/classes/
                                </Bundle-ClassPath>
                            </manifestEntries>
                        </archive>
                    
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                 //removed the plugin here  
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    <repositories>
        <repository>
            <id>glassfish-repo</id>
            <name>The Glassfish repository</name>
            <url>http://download.java.net/maven/glassfish/</url>
        </repository>
        <repository>  
            <id>prime-repo</id>  
            <name>PrimeFaces Maven Repository</name>  
            <url>http://repository.primefaces.org</url>  
            <layout>default</layout>  
        </repository>  
    </repositories>
    <description>Module History Module</description>
</project>

The configuration of the POM file is preventing Primefaces to work. If
replace the <build> section with simple WAR build configuration it will
work.
Do you find something unusual into this configuration that may cause the
problem?

Best wishes
Peter


--
View this message in context: http://apache-felix.18485.n6.nabble.com/Cannot-use-PrimeFaces-in-OSGI-bundle-tp4997874p4997901.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Cannot use PrimeFaces in OSGI bundle

Posted by Felix Meschberger <fm...@adobe.com>.
Hi,

I wonder why you embed the javaee-endorsed-api library ? Doesn't this add a whole lot of dependencies and required imports which may or may not be satisfied ?

Regards
Felix

Am 04.06.2012 um 21:21 schrieb Peter Penzov:

> Hi,
>   I have a WAR package with OSGI plugin. The package is deployed as OSGI
> bundle in Glassfish and it's working. I have a very strange problem with
> the POM file of the bundle: when I added Primefaces I get this error into
> the JSF page:
> 
> Warning: This page calls for xml namespace
> http://primefaces.org/uideclared with prefix p but no taglibtrary
> exist for that namespace
> 
> The problem is in these lines:
> 
> <build>
>    <pluginManagement>
> 
>        <plugins>
>               <plugin>
>                    <groupId>org.apache.felix</groupId>
>                    <artifactId>maven-bundle-plugin</artifactId>
>                    <version>2.1.0</version>
>                    <extensions>true</extensions>
>                    <configuration>
>                        <supportedProjectTypes>
>                            <supportedProjectType>ejb</supportedProjectType>
>                            <supportedProjectType>war</supportedProjectType>
> 
> <supportedProjectType>bundle</supportedProjectType>
>                            <supportedProjectType>jar</supportedProjectType>
>                        </supportedProjectTypes>
>                        <instructions>
>                            <!-- Read all OSGi configuration info from this
> optional file -->
>                            <_include>-osgi.properties</_include>
>                            <!-- By default, we don't export anything -->
>                            <Export-Package>!*.impl.*, *</Export-Package>
>                        </instructions>
>                    </configuration>
>                    <executions>
>                        <execution>
>                            <id>bundle-manifest</id>
>                            <phase>process-classes</phase>
>                            <goals>
>                                <goal>manifest</goal>
>                            </goals>
>                        </execution>
>                        <execution>
>                            <id>bundle-install</id>
>                            <phase>install</phase>
>                            <goals>
>                                <goal>install</goal>
>                            </goals>
>                        </execution>
>                    </executions>
>                </plugin>
> 
>             <plugin> <!-- Need to use this plugin to build war files -->
>                    <artifactId>maven-war-plugin</artifactId>
>                    <groupId>org.apache.maven.plugins</groupId>
>                    <!-- Use version 2.1-beta-1, as it supports the new
> property failOnMissingWebXml -->
>                    <version>2.1-beta-1</version>
>                    <configuration>
>                        <archive>
>                            <!-- add bundle plugin generated manifest to
> the war -->
>                            <manifestFile>
> 
> ${project.build.outputDirectory}/META-INF/MANIFEST.MF
>                            </manifestFile>
>                            <!-- For some reason, adding Bundle-ClassPath
> in maven-bundle-plugin
>                            confuses that plugin and it generates wrong
> Import-Package, etc.
>                            So, we generate it here.
>                            -->
>                            <manifestEntries>
>                                <Bundle-ClassPath>WEB-INF/classes/
>                                </Bundle-ClassPath>
>                            </manifestEntries>
>                        </archive>
>                    <!-- We don't have a web.xml -->
>                        <failOnMissingWebXml>false</failOnMissingWebXml>
>                    </configuration>
>                </plugin>
>              </plugins>
>        </pluginManagement>
>         <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-dependency-plugin</artifactId>
>                <version>2.1</version>
>                <executions>
>                    <execution>
>                        <phase>validate</phase>
>                        <goals>
>                            <goal>copy</goal>
>                        </goals>
>                        <configuration>
> 
> <outputDirectory>${endorsed.dir}</outputDirectory>
>                            <silent>true</silent>
>                            <artifactItems>
>                                <artifactItem>
>                                    <groupId>javax</groupId>
> 
> <artifactId>javaee-endorsed-api</artifactId>
>                                    <version>6.0</version>
>                                    <type>jar</type>
>                                </artifactItem>
>                            </artifactItems>
>                        </configuration>
>                    </execution>
>                </executions>
>            </plugin>
>             <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-compiler-plugin</artifactId>
>                <version>2.3.2</version>
>                <configuration>
>                    <source>1.7</source>
>                    <target>1.7</target>
>                    <compilerArguments>
>                        <endorseddirs>${endorsed.dir}</endorseddirs>
>                    </compilerArguments>
>                </configuration>
>            </plugin>
>            <plugin>
>                <!-- Enable this plugin for all modules -->
>                <groupId>org.apache.felix</groupId>
>                <artifactId>maven-bundle-plugin</artifactId>
>            </plugin>
>        </plugins>
>    </build>
> 
> Something is preventing the loading of the Primefaces jar but I cannot find
> what.
> If I remove these lines Primefaces are working normally. Can you help me to
> find the problem?
> 
> Best wishes
> Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org