users@glassfish.java.net

RE: Cannot properly deploy WAB, getting NullPointerException

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Wed, 6 Jun 2012 21:35:08 -0400

Safest path is to follow BND parameter conventionhttp://www.aqute.biz/Bnd/Format#import-package<Import-Package>"*" grabs all packages for import statements
like wise <Export-Package>"*" grabs all classes whereas your restriction to not include impl package with <Export-Package>!*.impl.*, *</Export-Package>may be a problem
<Bundle-Classpath>Defines the internal bundle class path, is taken into account by bnd. That is,
classes will be analyzed according to this path. The files/directories on the
Bundle-ClassPath must be present in the bundle. Use
Include-Resource to include these jars/directories in your bundle. *Authors Note*In general
you should not use Bundle-ClassPath since it makes
things more complicated than necessary. Use the @ option in the Include-Resource
to unroll the jars into the JAR.yours is <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>

<Include-Resource>The Include-Resource instruction makes it possible to include arbitrary
resources; it contains a list of resource paths. See
Include Resource.yours is empty.. The Embed and Dynamic attriibutes are not mentioned in Peters BND tutorial which only means the first version of the plugin did not factor these new attributesbut later versions *may* supportpersonally i would comment these out to see of they are causing the delay ...in fact
it would be best if you included one attriibute at a time until
you find the attribute thats failing the aggregation for the jar

then ping users_at_maven.apache.org with a bug report

and we'll jump on it asap
Martin Gainty
______________________________________________
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut ętre privilégié. Si vous n'ętes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert ŕ l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement ętre sujets ŕ la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 Date: Thu, 7 Jun 2012 00:06:51 +0300
Subject: Re: Cannot properly deploy WAB, getting NullPointerException
From: peter.penzov_at_gmail.com
To: users_at_glassfish.java.net

I use Maven 3.

This is my complete 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>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>

            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>

            <version>3.3</version>
        </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>
                            <!-- 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>
           
                <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>

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

I don't mind to test apache-felix-maven-bundle-plugin but I need help for writing the POM file.


On Wed, Jun 6, 2012 at 11:59 PM, Martin Gainty <mgainty_at_hotmail.com> wrote:





Good Afternoon Peter
<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>

i implement bundles thur maven-3 with the maven-bundle-plugin for example:
  <plugin>
      <groupId>org.apache.felix</groupId>

      <artifactId>maven-bundle-plugin</artifactId>
      <version>1.4.0</version>
      <extensions>true</extensions>
      <configuration>
          <instructions>

              <Bundle-SymbolicName>${pom.groupId}.${pom.artifactId}</Bundle-SymbolicName>
              <Bundle-Name>${pom.artifactId}</Bundle-Name>
              <Bundle-Version>1.0.0</Bundle-Version>

              <Private-Package>org.wso2.mbp.helloworld</Private-Package>
              <Bundle-Activator>org.wso2.mbp.helloworld.Activator</Bundle-Activator>
              <Import-Package>

                  org.osgi.framework,
                  *;resolution:=optional
              </Import-Package>
          </instructions>
   </configuration>
  </plugin>

http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

 
it does appear your bundling algorithm has gone fubar with no trace or log messages
can I convince you to implement the build with maven 3
and specifically implementing apache-felix-maven-bundle-plugin in the plugins secition so we can narrow down the problem?

   
Martin ...

Date: Wed, 6 Jun 2012 22:42:35 +0300
Subject: Cannot properly deploy WAB, getting NullPointerException
From: peter.penzov_at_gmail.com

To: users_at_glassfish.java.net


    0
    down vote
    favorite
       
 
    share [g+]
    share [fb]
    share [tw]


    

          
    
        I'm getting very strange error in Glassfish 3.1.2. I have a WAB package with Primefaces. I get this error them I open the WAB:


Jun 6, 2012 9:34:06 PM com.sun.enterprise.admin.launcher.GFLauncherLogger info


INFO: JVM invocation command line:
-XX:+UnlockDiagnosticVMOptions

-XX:PermSize=64m
-XX:MaxPermSize=192m


-XX:NewRatio=2
-Xmx512m

-client
-javaagent:/opt/glassfish3/glassfish/lib/monitor/flashlight-agent.jar


-Dosgi.shell.telnet.maxconn=1

-Dfelix.fileinstall.disableConfigSave=false

-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver


-Dfelix.fileinstall.dir=/opt/glassfish3/glassfish/modules/autostart/


-Djavax.net.ssl.keyStore=/opt/glassfish3/glassfish/domains/domain1/config/keystore.jks


-Dosgi.shell.telnet.port=6666

-Djava.security.policy=/opt/glassfish3/glassfish/domains/domain1/config/server.policy


-Djava.awt.headless=true

-Dfelix.fileinstall.log.level=2

-Dfelix.fileinstall.poll=5000

-Dcom.sun.aas.instanceRoot=/opt/glassfish3/glassfish/domains/domain1


-Dosgi.shell.telnet.ip=127.0.0.1

-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory


-Djava.endorsed.dirs=/opt/glassfish3/glassfish/modules/endorsed:/opt/glassfish3/glassfish/lib/endorsed


-Dcom.sun.aas.installRoot=/opt/glassfish3/glassfish


-Dfelix.fileinstall.bundles.startTransient=true

-Djava.ext.dirs=/opt/jdk1.7.0_03/lib/ext:/opt/jdk1.7.0_03/jre/lib/ext:/opt/glassfish3/glassfish/domains/domain1/lib/ext


-Dfelix.fileinstall.bundles.new.start=true

-Djavax.net.ssl.trustStore=/opt/glassfish3/glassfish/domains/domain1/config/cacerts.jks


-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as

-Djava.security.auth.login.config=/opt/glassfish3/glassfish/domains/domain1/config/login.conf


-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Dgosh.args=--nointeractive

Jun 6, 2012 9:34:06 PM com.sun.enterprise.admin.launcher.GFLauncherLogger info


INFO: Successfully launched in 9 msec.

[#|2012-06-06T21:34:11.356+0300|INFO|glassfish3.1.2|com.sun.enterprise.server.logging.GFFileHandler|_ThreadID=1;_ThreadName=Thread-2;|Running GlassFish Version: GlassFish Server Open Source Edition 3.1.2 (build 23)|#]



[#|2012-06-06T21:34:11.951+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=19;_ThreadName=Thread-2;|Grizzly Framework 1.9.46 started in: 143ms - bound to [0.0.0.0:8080]|#]



[#|2012-06-06T21:34:11.975+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=22;_ThreadName=Thread-2;|Grizzly Framework 1.9.46 started in: 73ms - bound to [0.0.0.0:8181]|#]



[#|2012-06-06T21:34:12.061+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=26;_ThreadName=Thread-2;|Grizzly Framework 1.9.46 started in: 16ms - bound to [0.0.0.0:4848]|#]



[#|2012-06-06T21:34:12.079+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-2;|Grizzly Framework 1.9.46 started in: 20ms - bound to [0.0.0.0:3700]|#]



[#|2012-06-06T21:34:12.097+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=32;_ThreadName=Thread-2;|Grizzly Framework 1.9.46 started in: 19ms - bound to [0.0.0.0:7676]|#]



[#|2012-06-06T21:34:12.327+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.admin.adapter|_ThreadID=1;_ThreadName=Thread-2;|The Admin Console is already installed, but not yet loaded.|#]



[#|2012-06-06T21:34:12.356+0300|INFO|glassfish3.1.2|org.glassfish.ha.store.spi.BackingStoreFactoryRegistry|_ThreadID=1;_ThreadName=Thread-2;|Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry|#]



[#|2012-06-06T21:34:12.835+0300|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=Thread-2;|CORE10012: Application previously deployed is not at its original location any more: file:/opt/glassfish3/glassfish/domains/domain1//applications/History-Module-57-1.0-SNAPSHOT/|#]



[#|2012-06-06T21:34:12.843+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=Thread-2;|GlassFish Server Open Source Edition 3.1.2 (23) startup time : Felix (4,005ms), startup services(2,027ms), total(6,032ms)|#]



[#|2012-06-06T21:34:13.827+0300|INFO|glassfish3.1.2|javax.enterprise.system.jmx.org.glassfish.admin.mbeanserver|_ThreadID=40;_ThreadName=Thread-2;|JMX005: JMXStartupService had Started JMXConnector on JMXService URL service:jmx:rmi://Testserver:8686/jndi/rmi://Testserver:8686/jmxrmi|#]



[#|2012-06-06T21:34:14.216+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.admin.adapter|_ThreadID=49;_ThreadName=Thread-2;|The Admin Console is already installed, but not yet loaded.|#]



[#|2012-06-06T21:34:14.218+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.admin.adapter|_ThreadID=49;_ThreadName=Thread-2;|The Admin Console is starting. Please wait.|#]



[#|2012-06-06T21:34:16.204+0300|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=12;_ThreadName=Thread-2;|WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]|#]



[#|2012-06-06T21:34:16.234+0300|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=12;_ThreadName=Thread-2;|WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]|#]



[#|2012-06-06T21:34:16.256+0300|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=12;_ThreadName=Thread-2;|WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:4848]|#]



[#|2012-06-06T21:34:16.352+0300|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=12;_ThreadName=Thread-2;|WEB0171: Created virtual server [server]|#]



[#|2012-06-06T21:34:16.360+0300|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=12;_ThreadName=Thread-2;|WEB0171: Created virtual server [__asadmin]|#]



[#|2012-06-06T21:34:17.323+0300|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=12;_ThreadName=Thread-2;|WEB0172: Virtual server [server] loaded default web module []|#]



[#|2012-06-06T21:34:20.016+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security|_ThreadID=49;_ThreadName=Thread-2;|SEC1002: Security Manager is OFF.|#]



[#|2012-06-06T21:34:20.062+0300|INFO|glassfish3.1.2|org.glassfish.osgihttp|_ThreadID=12;_ThreadName=Thread-2;|defaultVirtualServer = server|#]



[#|2012-06-06T21:34:20.157+0300|INFO|glassfish3.1.2|org.apache.catalina.startup.ContextConfig|_ThreadID=12;_ThreadName=Thread-2;|No default web.xml|#]



[#|2012-06-06T21:34:20.170+0300|INFO|glassfish3.1.2|org.glassfish.osgihttp|_ThreadID=12;_ThreadName=Thread-2;|standardContext = StandardEngine[glassfish-web].StandardHost[server].StandardContext[/osgi]|#]



[#|2012-06-06T21:34:20.187+0300|INFO|glassfish3.1.2|org.apache.catalina.startup.ContextConfig|_ThreadID=12;_ThreadName=Thread-2;|No default web.xml|#]



[#|2012-06-06T21:34:20.195+0300|INFO|glassfish3.1.2|org.glassfish.osgihttp|_ThreadID=12;_ThreadName=Thread-2;|standardContext = StandardEngine[glassfish-web].StandardHost[__asadmin].StandardContext[/osgi]|#]



[#|2012-06-06T21:34:20.282+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security|_ThreadID=49;_ThreadName=Thread-2;|SEC1010: Entering Security Startup Service|#]



[#|2012-06-06T21:34:20.299+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security|_ThreadID=49;_ThreadName=Thread-2;|SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.|#]



[#|2012-06-06T21:34:20.437+0300|INFO|glassfish3.1.2|org.glassfish.osgi.felixwebconsoleextension|_ThreadID=12;_ThreadName=Thread-2;|Registered org.glassfish.osgi.felixwebconsoleextension.GlassFishBrandingPlugin_at_4463de41|#]



[#|2012-06-06T21:34:20.512+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=49;_ThreadName=Thread-2;|SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.|#]



[#|2012-06-06T21:34:20.514+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=49;_ThreadName=Thread-2;|SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.|#]



[#|2012-06-06T21:34:20.545+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=49;_ThreadName=Thread-2;|SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.|#]



[#|2012-06-06T21:34:20.578+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security|_ThreadID=49;_ThreadName=Thread-2;|SEC1011: Security Service(s) Started Successfully|#]



[#|2012-06-06T21:34:24.075+0300|INFO|glassfish3.1.2|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=49;_ThreadName=Thread-2;|Initializing Mojarra 2.1.9 (SNAPSHOT 20120531-1326) for context ''|#]



[#|2012-06-06T21:34:26.567+0300|INFO|glassfish3.1.2|org.hibernate.validator.util.Version|_ThreadID=49;_ThreadName=Thread-2;|Hibernate Validator 4.2.0.Final|#]



[#|2012-06-06T21:34:28.739+0300|INFO|glassfish3.1.2|org.primefaces.webapp.PostConstructApplicationEventListener|_ThreadID=49;_ThreadName=Thread-2;|Running on PrimeFaces 3.3|#]



[#|2012-06-06T21:34:28.863+0300|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=49;_ThreadName=Thread-2;|WEB0671: Loading application [__admingui] at [/]|#]



[#|2012-06-06T21:34:28.867+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=49;_ThreadName=Thread-2;|CORE10010: Loading application __admingui done in 14,648 ms|#]



[#|2012-06-06T21:34:28.868+0300|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.admin.adapter|_ThreadID=49;_ThreadName=Thread-2;|The Admin Console application is loaded.|#]



[#|2012-06-06T21:34:34.022+0300|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.container.common|_ThreadID=66;_ThreadName=Thread-2;|User [] from host localhost does not have administration access|#]



[#|2012-06-06T21:34:41.658+0300|INFO|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=72;_ThreadName=Thread-2;|Created EjbThreadPoolExecutor with thread-core-pool-size 16 thread-max-pool-size 32 thread-keep-alive-seconds 60 thread-queue-capacity 2147483647 allow-core-thread-timeout false |#]



[#|2012-06-06T21:34:43.337+0300|INFO|glassfish3.1.2|com.sun.jersey.server.impl.application.WebApplicationImpl|_ThreadID=72;_ThreadName=Thread-2;|Initiating Jersey application, version 'Jersey: 1.11 12/09/2011 10:27 AM'|#]



[#|2012-06-06T21:34:44.548+0300|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.admin.rest.adapter|_ThreadID=72;_ThreadName=Thread-2;|REST00001: Listening to REST requests at context: /management/domain|#]



[#|2012-06-06T21:34:44.630+0300|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=71;_ThreadName=Thread-2;|Redirecting to /login.jsf|#]



[#|2012-06-06T21:35:12.278+0300|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=65;_ThreadName=Thread-2;|Admin Console: Initializing Session Attributes...|#]



[#|2012-06-06T21:35:26.299+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=159;_ThreadName=Thread-2;|Originally deployed application at /opt/glassfish3/glassfish/domains/domain1/applications/History-Module-57-1.0-SNAPSHOT not found|#]



[#|2012-06-06T21:35:26.761+0300|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=165;_ThreadName=Thread-2;|com.sun.webui.jsf.component.DropDown::The current value of component propertyForm:deployTable:topActionsGroup1:filter does not match any of the selections.


Did you forget to reset the value after changing the options? |#]


[#|2012-06-06T21:35:43.592+0300|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=152;_ThreadName=Thread-2;|GUI deployment: uploadToTempfile|#]



[#|2012-06-06T21:35:43.614+0300|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=152;_ThreadName=Thread-2;|uploadFileName=History-Module-57-1.0-SNAPSHOT.war|#]



[#|2012-06-06T21:35:44.631+0300|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=154;_ThreadName=Thread-2;|Installed com.DX_57.History-Module-57 [311] from reference:file:/opt/glassfish3/glassfish/domains/domain1/applications/History-Module-57-1.0-SNAPSHOT/|#]



[#|2012-06-06T21:35:44.650+0300|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=154;_ThreadName=Thread-2;|Started com.DX_57.History-Module-57 [311]|#]



[#|2012-06-06T21:35:44.761+0300|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=154;_ThreadName=Thread-2;|History-Module-57-1.0-SNAPSHOT was successfully deployed in 1,110 milliseconds.|#]



[#|2012-06-06T21:35:45.075+0300|INFO|glassfish3.1.2|org.glassfish.osgijavaeebase|_ThreadID=56;_ThreadName=Thread-2;|Expanded at file:/tmp/osgiapp3530448283957423910/|#]



[#|2012-06-06T21:35:45.123+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=57;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.125+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=57;_ThreadName=Thread-2;|error in opening zip file -- ?invalid zip file: file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.132+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=59;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.132+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=59;_ThreadName=Thread-2;|error in opening zip file -- ?invalid zip file: file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.133+0300|SEVERE|glassfish3.1.2|org.glassfish.osgijavaeebase|_ThreadID=59;_ThreadName=Thread-2;|Exception while parsing file file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar


java.lang.NullPointerException
? ? at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.<init>(InputJarArchive.java:573)


? ? at com.sun.enterprise.deployment.deploy.shared.InputJarArchive$ArchiveJarEntrySource.<init>(InputJarArchive.java:565)


? ? at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.createEntryEnumeration(InputJarArchive.java:443)


? ? at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.entries(InputJarArchive.java:196)


? ? at com.sun.enterprise.deployment.deploy.shared.InputJarArchive.entries(InputJarArchive.java:175)


? ? at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:128)


? ? at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:348)


? ? at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:70)


? ? at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:307)


? ? at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:296)


? ? at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)


? ? at java.util.concurrent.FutureTask.run(FutureTask.java:166)


? ? at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)


? ? at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)


? ? at java.lang.Thread.run(Thread.java:722)


|#]

[#|2012-06-06T21:35:45.471+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=56;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.472+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=56;_ThreadName=Thread-2;|error in opening zip file -- ?invalid zip file: file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.567+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=56;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.567+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=56;_ThreadName=Thread-2;|error in opening zip file -- ?invalid zip file: file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.671+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=56;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.680+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=56;_ThreadName=Thread-2;|error in opening zip file -- ?invalid zip file: file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:45.985+0300|INFO|glassfish3.1.2|org.jboss.weld.Version|_ThreadID=56;_ThreadName=Thread-2;|WELD-000900 1.1.4 (Final)|#]



[#|2012-06-06T21:35:46.010+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=56;_ThreadName=Thread-2;|DPL8004: file open failure; file = file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:46.012+0300|WARNING|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=56;_ThreadName=Thread-2;|error in opening zip file -- ?invalid zip file: file:/tmp/osgiapp3530448283957423910/WEB-INF/lib/Bundle311.jar|#]



[#|2012-06-06T21:35:47.730+0300|INFO|glassfish3.1.2|org.glassfish.osgiweb|_ThreadID=56;_ThreadName=Thread-2;|total number of classes with faces annotation = 0|#]



[#|2012-06-06T21:35:48.120+0300|INFO|glassfish3.1.2|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=56;_ThreadName=Thread-2;|Initializing Mojarra 2.1.9 (SNAPSHOT 20120531-1326) for context '/test'|#]



[#|2012-06-06T21:35:48.125+0300|INFO|glassfish3.1.2|org.glassfish.osgiweb|_ThreadID=56;_ThreadName=Thread-2;|Faces Config uris excluding the ones named as faces-config.xml = []|#]



[#|2012-06-06T21:35:48.413+0300|INFO|glassfish3.1.2|org.glassfish.osgiweb|_ThreadID=56;_ThreadName=Thread-2;|Facelet Config uris = [embeddedjar:bundle://311.0:0/WEB-INF/lib/primefaces-3.3.jar!/META-INF/primefaces-p.taglib.xml]|#]



[#|2012-06-06T21:35:48.775+0300|INFO|glassfish3.1.2|org.primefaces.webapp.PostConstructApplicationEventListener|_ThreadID=56;_ThreadName=Thread-2;|Running on PrimeFaces 3.3|#]



[#|2012-06-06T21:35:48.787+0300|INFO|glassfish3.1.2|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=56;_ThreadName=Thread-2;|Monitoring jndi:/server/test/WEB-INF/faces-config.xml for modifications|#]



[#|2012-06-06T21:35:48.843+0300|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=56;_ThreadName=Thread-2;|WEB0671: Loading application [com.DX_57.History-Module-57_1.0.0.SNAPSHOT] at [/test]|#]



[#|2012-06-06T21:35:48.864+0300|INFO|glassfish3.1.2|org.glassfish.osgiweb|_ThreadID=56;_ThreadName=Thread-2;|Registered ServletContext as a service with properties: {osgi.web.symbolicname=com.DX_57.History-Module-57, osgi.web.version=1.0.0.SNAPSHOT, osgi.web.contextpath=/test} |#]



[#|2012-06-06T21:35:48.872+0300|INFO|glassfish3.1.2|org.glassfish.osgijavaeebase|_ThreadID=56;_ThreadName=Thread-2;|deployed bundle com.DX_57.History-Module-57 [311] at file:/tmp/osgiapp3530448283957423910/|#]




I restarted the server and I cleaned /tmp directory, but this doesn't help? Any I ideas where might be the problem?


In order to use Primefaces into WAB I added this configuration into the WAB file. Maybe something is wrong here:


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


EDIT


Wow! I opened the file Bundle311.jar with archive manager and I get this message: Archive:
  /home/rcbandit/.cache/.fr-d7GzLk/Bundle316.jar
[/home/rcbandit/.cache/.fr-d7GzLk/Bundle316.jar]
  End-of-central-directory signature not found. Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive. In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
zipinfo: cannot find zipfile directory in one of
/home/rcbandit/.cache/.fr-d7GzLk/Bundle316.jar or
          /home/rcbandit/.cache/.fr-d7GzLk/Bundle316.jar.zip, and cannot
 find /home/rcbandit/.cache/.fr-d7GzLk/Bundle316.jar.ZIP, period. Maybe the archive is wrong and it's not deployed correctly




        I thing the problem is caused by malformed .jar file. But why?