users@glassfish.java.net

Re: [Glassfish 3] Deployment fails on a NullPointerException.

From: <glassfish_at_javadesktop.org>
Date: Sun, 11 Apr 2010 06:55:14 PDT

I succeed in compiling my first version of Glassfish, and I have added the lines in italic to
org.glassfish.appclient.server.core.AppClientDeployerHelper in the function generateAppClientFacade()



    protected final void generateAppClientFacade() throws IOException, URISyntaxException {
        OutputJarArchive facadeArchive = new OutputJarArchive();
[b] /*
         * Make sure the directory subtree to contain the facade exists. If the
         * client URI within the EAR contains a directory then that directory
         * probably does not exist in the generated dir for this app...not yet
         * anyway...it is about to exist.
         */
[/b] final File facadeFile = new File(facadeServerURI(dc));
        if ( ! facadeFile.getParentFile().exists()) {
            facadeFile.getParentFile().mkdirs();
        }
        facadeArchive.create(facadeServerURI(dc));
        ReadableArchive source = dc.getSource();
[i] assert(source != null) : "Source archive is expected not null, in order to get manifests.";

        Manifest sourceManifest = source.getManifest();

[b] // If the source manifest is null, throw an exception.
[/b] if (sourceManifest == null)
        {
           String message = MessageFormat.format("Unable to find source manifest for {0} in {1}.", source.getName(), source.getURI());
           throw(new DeploymentException(message));
        }

        Manifest facadeManifest = facadeArchive.getManifest();

[b] // If the facade manifest is null, throw an exception.[/b]
        if (facadeManifest == null)
        {
           String message = MessageFormat.format("Unable to find facade manifest for {0} in {1}.", facadeArchive.getName(), facadeArchive.getURI());
           throw(new DeploymentException(message));
        }
[/i]
        initGeneratedManifest(sourceManifest, facadeManifest,
                facadeClassPath(), PUScanTargets(), application);


Now, at deployment time, I receive this message:

Exception while preparing the app : org.glassfish.deployment.common.DeploymentException: Unable to find source manifest for javancss_jar in file:/C:/Outils/Programmation/glassfishv3.1/glassfish/domains/domain1/applications/SystemeTest/javancss_jar/.

javancss.jar is a third party jar I used in my ear.
Looking inside it, this is true: it has no MANIFEST.MF file, if it was that that Glassfish was looking for. This jar is joined to this message, in case it would have any use...


Due to the fact I am a complete newbie in the Glassfish project, I didn't attempted to do any checking, and not even did any change to the issue. I wished you to look these changes to validate them, and maybe take them into account.

Regards,

Grunt.
[Message sent by forum member 'grunt2000']

http://forums.java.net/jive/thread.jspa?messageID=396345