users@glassfish.java.net

Re: Glassfish V3 exception in JPADeployer when trying to deploy

From: <glassfish_at_javadesktop.org>
Date: Wed, 06 Jan 2010 07:11:11 PST

Sorry to triple post but I'm not getting much help so here's some more information. Looking at the source code here's where it is failing:
[code]
    /**
     * EMFs for refered pus are created and stored in JPAApplication instance.
     * The JPAApplication instance is stored in given DeploymentContext to be retrieved by load
     */
    @Override public boolean prepare(DeploymentContext context) {
        boolean prepared = super.prepare(context);

            if(prepared) {
               Application application = context.getModuleMetaData(Application.class);
               Set<BundleDescriptor> bundles = application.getBundleDescriptors();

                // Iterate through all the bundles for the app and collect pu references in referencedPus
                List<PersistenceUnitDescriptor> referencedPus = new ArrayList<PersistenceUnitDescriptor>();
                for (BundleDescriptor bundle : bundles) {
                    Collection<? extends PersistenceUnitDescriptor> pusReferencedFromBundle = bundle.findReferencedPUs();
                   for(PersistenceUnitDescriptor pud : pusReferencedFromBundle) { /*NullPointerException ---->*/
                        referencedPus.add(pud);
                    }
                }
[/code]
The problem is pusReferencedFromBundle is null which means the call to bundle.findReferencedPUs() is returning null. Well it turns out that the bundle is an instance of ConnectorDescriptor which doesn't implement the method so the one in the base class BundleDescriptor is called which simple asserts false and returns null. The comments in the code say it's done this way on purpose because it doesn't expect to get called....

Anyway I'm using a resource adapter but I don't know if that is part of the problem or not. Any help would be greatly appreciated.
[Message sent by forum member 'cain05' (cain05_at_gmail.com)]

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