[jboss-dev-forums] [Deployers on JBoss (Deployers/JBoss)] - Re: HOWTO deploy webapp dynamically

adrian@jboss.org do-not-reply at jboss.com
Wed Feb 27 15:56:46 EST 2008


The relevant code is in the ServiceDeployer:

  |    public void deploy(DeploymentUnit unit, ServiceMetaData deployment) throws DeploymentException
  |    {
  |       ObjectName name = deployment.getObjectName();
  |       try
  |       {
  |          ObjectName loaderName = deployment.getClassLoaderName();
  |          if (loaderName == null)
  |          {
  |             ClassLoader cl = unit.getClassLoader();
  |             if (cl != null && cl instanceof RepositoryClassLoader)
  |                loaderName = ((RepositoryClassLoader) cl).getObjectName();
  |             // TODO add to RealClassLoader
  |             else if (cl != null && cl instanceof RealClassLoader)
  |                loaderName = ((RealClassLoader) cl).getObjectName();
  |             else
  |                loaderName = defaultClassLoader;
  |          }
  | 

I'd guess the actual classloader Thomas is passing in, is not a RealClassLoader
(but it probably has one as a parent) so this code should loop through
ClassLoader::getParent() until it finds one that is, before trying to use
"defaultClassLoader" which doesn't look like it is even configured.

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

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



More information about the jboss-dev-forums mailing list