6 Replies Latest reply on Nov 26, 2008 1:55 AM by wolfc

    Failing 'factory' tests

    alrubinger

      This one is for Carlo.

      Server error is:

      Caused by: java.lang.IllegalArgumentException: Can't find a deployment unit named session2.jar at AbstractVFSDeploymentContext@206176{vfszip:/home/alrubinger/business/jboss/wc/jbossas/projects/ejb3/trunk/testsuite/target/test-lib/factory-test.ear}


      EAR layout is:

      EAR
      |--- session1.jar
      |--- session2.jar


      ..and the resolving code is:

      private static DeploymentUnit getDeploymentUnit(DeploymentUnit current, String path)
       {
       if(path.startsWith("/"))
       return getDeploymentUnit(current.getTopLevel(), path.substring(1));
       if(path.startsWith("./"))
       return getDeploymentUnit(current, path.substring(2));
       if(path.startsWith("../"))
       return getDeploymentUnit(current.getParent(), path.substring(3));
       int i = path.indexOf('/');
       String name;
       if(i == -1)
       name = path;
       else
       name = path.substring(0, i);
       for(DeploymentUnit child : current.getChildren())
       {
       if(child.getName().equals(name))
       return child;
       }
       throw new IllegalArgumentException("Can't find a deployment unit named " + name + " at " + current);
       }


      We can only get PersistenceUnits of child relationships? Not siblings or of anything else in the same EAR?

      S,
      ALR