0 Replies Latest reply on May 15, 2006 9:18 AM by J-C jc

    Problem with EJB3StandaloneDeployer & persistence.xml

    J-C jc Apprentice

      I try to include the JBoss embeddable EJB3 in my JUnit test enviromnent. EJB3StandaloneBootstrap.scanClasspath uses the classpath in java.class.path. For my test I use several classloader (classpath is not defined in java.class.path. Consequenlty I need to deploy my tests using the EJB3StandaloneDeployer.

      Tests classes and persistence.xml are in several directories. I wrotte the following code:

      EJB3StandaloneDeployer deployer = EJB3StandaloneBootstrap.createDeployer();
      deployer.getDeployDirs().add(url1);
      deployer.getDeployDirs().add(url2);
      ...
      deployer.create();
      deployer.start();
      

      With previous source code, bean using entity manager of the persistence.xml are not deployed. It seems that persistence.xml is not find.

      I need to explicitely add the resource directory using:
      deployer.getArchives().add(urlContainingThePersistence_xml);
      

      where urlContainingThePersistence_xml is an url for a directory (not a jar file). I thought that in that case I should used getDeployDirs instead of getArchive. Is is a bug ?

      Or maybe be I'm doing something worng ! Any sugestion are welcome.