[jboss-dev-forums] [Design of POJO Server] - Re: Scoping of war/jar file embedded in sar service archives

alesj do-not-reply at jboss.com
Sat Jul 19 11:25:15 EDT 2008


Cause for reopening JBDEPLOY-59.

I commited deployers/build/pom.xml to use the latest Classloading snapshot.

The ManifestClassLoaderUnitTestCase is failing due to ordering issue.

With the new Classloading code that tries to resolve ClassLoadingSpace,
this piece causes child modules to declare its vfs roots before parent modules.

org.jboss.classloading.spi.dependency.Domain:

  |          // Skip the classloader space checking when it is import all
  |          if (module.isImportAll() == false)
  |          {
  |             ClassLoadingSpace space = new ClassLoadingSpace();
  |             space.join(module); // starting here!
  |          }
  | 
In the test top-level.jar is import-all == true,
where top-levelsub.jar is import-all == false.

1) space.join(module) calls module.determinePackageNames
2) module.getCapabilities calls module.determineCapabilities
3) module.determineCapabilities in VFSDeploymentClassLoaderPolicyModule uses determineVFSRoots

And since parent hasn't been yet examined,
this code is never called

  |             Set<VirtualFile> parentClassPath = parent.getAttachment(VFS_CLASS_PATH, Set.class);
  |             if (parentClassPath != null)
  |             {
  |                if (log.isTraceEnabled())
  |                {
  |                   for (VirtualFile parentFile : parentClassPath)
  |                   {
  |                      if (classPath.contains(parentFile))
  |                         log.trace(unit + " weeding duplicate entry " + parentFile + " from classpath already in parent " + parent);
  |                   }
  |                }
  |                classPath.removeAll(parentClassPath);
  |             }
  | 
leaving the sub's classpath intact.
Hence it loads class from it's own classloader.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165497#4165497

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165497



More information about the jboss-dev-forums mailing list