users@glassfish.java.net

Re: Primefaces.jar as GlassFish module

From: Peter Penzov <peter.penzov_at_gmail.com>
Date: Wed, 6 Jun 2012 20:13:04 +0300

It turns out that the problem is caused by POM configuration. JIRA:
GLASSFISH-11606 helped me (well with a few problems)

I edited the POM file this way:


<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>
                            <DynamicImport-Package>javax.*, org.*,
com.sun.faces.*</DynamicImport-Package>

<Import-Package>*;resolution:=optional</Import-Package>

<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
                            <Embed-Transitive>true</Embed-Transitive>
                            <Embed-Directory>WEB-INF/lib</Embed-Directory>
                            <Embed-StripVersion>false</Embed-StripVersion>
                            <Embed-StripGroup>true</Embed-StripGroup>

<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>

                        </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>

I needed this configuration in order to include Primefaces:
                            <Export-Package>!*.impl.*, *</Export-Package>
                            <DynamicImport-Package>javax.*, org.*,
com.sun.faces.*</DynamicImport-Package>

<Import-Package>*;resolution:=optional</Import-Package>

<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
                            <Embed-Transitive>true</Embed-Transitive>
                            <Embed-Directory>WEB-INF/lib</Embed-Directory>
                            <Embed-StripVersion>false</Embed-StripVersion>
                            <Embed-StripGroup>true</Embed-StripGroup>

<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>

Now I have a problem and a question:

1. I can display Primefaces for example input fields and etc but data only
without beans. If I use beans with Primefaces the JSF page is empty. Maybe
the beans are not visible and I need to modify the POM.

2. I added Primefaces.jar as Glassfish module with the command:

[root_at_Testserver bin]# sh asadmin add-library /opt/primefaces.jar

But when I remove from the OSGI bundle Primefaces the bundle is not using
the Glassfish's module. Maybe I need to add some configuration to the
bundle in order to tell it to use the default Primefaces.jar deployed into
the Glassfish. How I can do this?


On Tue, Jun 5, 2012 at 9:45 PM, Sathyan Catari <Sathyan.Catari_at_oracle.com>wrote:

> Please refer
> http://docs.oracle.com/cd/E26576_01/doc.312/e24938/add-library.htm
>
> Thanks
> Sathyan
>
>
>
> On 6/5/12 11:42 AM, Peter Penzov wrote:
>
> I want to deploy Primefaces.jar as Glassfish module. I downloaded
> Primefaces.jar<http://repository.primefaces.org/org/primefaces/primefaces/3.3/primefaces-3.3.jar>and I copied the jar into
> glassfish3/glassfish/modules folder. Then I added the name
> primefaces-3.3.jar into
> glassfish3/glassfish/domains/domain1/config/default-web.xml but nothing
> happens. What am I missing?
>
>