-
1. Re: JBAS-5689, bootstrap deployments not seen by profileserv
starksm64 Nov 6, 2008 11:35 PM (in response to starksm64)This is affecting getting hold of runtime beans like the ServerInfo bean that is loaded by the conf/jmx.xml bootstrap piece.
So I'm looking at extending the Bootstrap interface to make the start signature:start(Server server, Map<String, KernelDeployment> serverDeployments)
and then pass this onto the MainDeployer.addDeployment(Deployment) without having these reprocessed. It looks this would require a change in the MainDeployerImpl.addContext(DeploymentContext context, boolean addToDeploy) to look for a DeploymentState.DEPLOYED and simply add it to the deploy list, bypassing the deployers.
Does this sound like the best approach? -
2. Re: JBAS-5689, bootstrap deployments not seen by profileserv
starksm64 Nov 7, 2008 8:45 AM (in response to starksm64)In terms of Bootstraps getting access to the KernelDeployments, I have done this in a less invasive change where the Bootstrap interface remains the same, but there is now a MCServer spi that extends Server to provide access to the Kernel and KernelDeployments:
public interface MCServer extends Server { public Kernel getKernel(); public Map<String, KernelDeployment> getDeployments(); }
-
3. Re: JBAS-5689, bootstrap deployments not seen by profileserv
starksm64 Nov 7, 2008 9:19 AM (in response to starksm64)It seems like we need an additional DeploymentState like EXTERNAL that flags a DeploymentUnit/DeploymentContext as not subject to the deploy/undeploy behavor of the MainDeployer. The problem with just ignoring DeploymentState.DEPLOYED deployments in addContext is that it will be undeployed when the MainDeployer is shutdown.
Alternatively, the ManagedDeployment/ManagedObject stuff needs to be pulled out of the MainDeployer since we are interested in this information for deployments that are outside of the MainDeployer. Maybe the bootstrap ManagedDeployments can just be created separately without reference to the MainDeployer. I'll explore that more today as the current path is too invasive. -
4. Re: JBAS-5689, bootstrap deployments not seen by profileserv
starksm64 Nov 13, 2008 2:33 AM (in response to starksm64)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); } }
-
5. Re: JBAS-5689, bootstrap deployments not seen by profileserv
alesj Nov 13, 2008 4:28 AM (in response to starksm64)"scott.stark@jboss.org" wrote:
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?
This 3 page discussion explains why:
- http://www.jboss.com/index.html?module=bb&op=viewtopic&t=144593