[jboss-dev-forums] [Design of POJO Server] - Re: Scoped domain with java2ParentDelegation=false loads cla

adrian@jboss.org do-not-reply at jboss.com
Fri Oct 12 08:45:51 EDT 2007


The second part of your comment doesn't make sense.
I think you are confusing explicit exports (named packages)
with the "exportAll" behaviour (packages are discovered from a scan of the deployment
classpath).

It is clearly trying to load to resource from the classloader and not finding it:


  | 
  | Trying all classloaders in the domain
  | 
  | 2007-10-12 11:34:10,921 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] ClassLoaderDoma
  | in at 1f21056{<DEFAULT>} trying to get resource org/jboss/test/aop/scopedextender/blah.txt from all exports [VFSClassLoader
  | Policy at c1a0a6]
  | 
  | This one matches.
  | 
  | 2007-10-12 11:34:10,921 TRACE [org.jboss.classloader.spi.filter.FilteredDelegateLoader] FilteredDele
  | gateLoader at d63b75{delegate=VFSClassLoaderPolicy at c1a0a6} org/jboss/test/aop/scopedextender/blah.txt m
  | atches resource filter=[org.jboss.test.aop.scopedextender, aop-scopedextender-base.jar.META-INF, MET
  | A-INF, aop-scopedextender-base.aop.META-INF, aop-scopedextender-base.jar.org.jboss.test.aop.scopedex
  | tender]
  | 
  | Tries to find it using the VFS
  | 
  | 2007-10-12 11:34:10,921 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] BaseClassLoader at 1b28a
  | f8 get resource locally org/jboss/test/aop/scopedextender/blah.txt
  | 
  | Not found!
  | 
  | 2007-10-12 11:34:10,937 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] org.jboss.classloader
  | .spi.base.BaseClassLoader$2 at d9be5a resource not found locally org/jboss/test/aop/scopedextender/blah
  | .txt
  | 

Like I said earlier, hack the policy to turn off the blacklisting and caching,
but this is clearly irrelevant if it can't find the resource in the first place.

The code to find the resource is:


  | 
  |    @Override
  |    public URL getResource(String path)
  |    {
  |       VirtualFile child = findChild(path);
  |       if (child != null)
  |       {
  |          try
  |          {
  |             return child.toURL();
  |          }
  |          catch (Exception ignored)
  |          {
  |             log.trace("Error determining URL for " + child, ignored);
  |             return null;
  |          }
  |       }
  |       return null;
  |    }
  | 
  |    /**
  |     * Find a child from a path
  |     * 
  |     * @param path the path
  |     * @return the child if found in the roots
  |     */
  |    protected VirtualFile findChild(String path)
  |    {
  |       for (VirtualFile root : roots)
  |       {
  |          try
  |          {
  |             return root.findChild(path);
  |          }
  |          catch (Exception ignored)
  |          {
  |             // not found
  |          }
  |       }
  |       return null;
  |    }
  | 

with the "roots" coming from the determineAllPackages() for "exportAll",
you can see this result in the filter of logging above.

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

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



More information about the jboss-dev-forums mailing list