[jboss-dev-forums] [Design of POJO Server] - Re: JBAS-5689, bootstrap deployments not seen by profileserv

scott.stark@jboss.org do-not-reply at jboss.com
Thu Nov 13 02:33:15 EST 2008


What I am trying is to build the bootstrap KernelDeployment ManagedDeployments in the ProfileServiceBootstrap start. This is working except for the conf/initialize.xml as it fails to 


  | Caused by: java.lang.IllegalStateException: ClassLoader has not been set
  | 	at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.getClassLoader(AbstractDeploymentUnit.java:152)
  | 	at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.addBeanComponent(BeanMetaDataFactoryVisitor.java:60)
  | 	at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:126)
  | 	... 6 more
  | 

Why in the BeanMetaDataFactoryVisitor.addBeanComponent is it ok to use the className when there is only a ClassLoaderMetaData set, but no DeploymentUnit.classLoader, but if there is no ClassLoaderMetaData, we try to load the class?

  |    protected static void addBeanComponent(DeploymentUnit unit, BeanMetaData bean)
  |    {
  |       DeploymentUnit component = unit.addComponent(bean.getName());
  |       component.addAttachment(BeanMetaData.class.getName(), bean);
  |       String className = bean.getBean();
  |       if (className != null)
  |       {
  |          Object qualifier;
  |          if (bean.getClassLoader() == null)
  |          {
  |             ClassLoader cl = unit.getClassLoader();
  |             try
  |             {
  |                qualifier = cl.loadClass(className);
  |             }
  |             catch (Exception e)
  |             {
  |                throw new IllegalArgumentException("Exception loading class for ScopeKey addition.", e);
  |             }
  |          }
  |          else
  |          {
  |             qualifier = className;
  |          }
  |          component.getScope().addScope(CommonLevels.CLASS, qualifier);
  |       }
  |    }
  | 


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

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



More information about the jboss-dev-forums mailing list