6 Replies Latest reply: Apr 20, 2012 7:40 AM by b69 RSS

JBAS011440: Can't find a persistence unit named null in deployment

b69 Newbie

Within my RequirementBeanTest I have the following deployment declaration:

 

@Deployment

    public static JavaArchive createDeployment() {

        JavaArchive arch = ShrinkWrap.create(JavaArchive.class, "MonteRosaEJBtest.jar");

        Package pAspect = Facets.class.getPackage();

        Package pReports = DocumentKind.class.getPackage();

        Package pEjb = Requirements.class.getPackage();

        Package pEnt = Project.class.getPackage();

        arch.addPackages(true, pEjb);

        arch.addPackages(true, pEnt);

        arch.addAsResource("ldap.properties");

        arch.addPackage(pAspect);

        arch.addPackage(pReports);

        arch.addAsResource("enumKeyWords.properties");

//        arch.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

        arch.addAsManifestResource("Meta-INF/persistence.xml");

        return arch;

    }

 

which cause me the deployment errors as shown in the attachment.

The persistence.xml can't be found! It was a hard work, to assemble all the above, because the gap from the hello Earthling example to the real world is very big for a starter.

Please give me a hint, how to declare properly. Its an EJB module of a larger application. The Packages pAspect and pReports are from a further module, normally in a jar, but as far as I could see, packaged properly into the arch.

Thanks.