[jboss-dev-forums] [Design the new POJO MicroContainer] - serializable KernelDeployment

bill.burke@jboss.com do-not-reply at jboss.com
Fri Jan 19 09:14:45 EST 2007


I was experimenting with serializing a KernelDeployment, unserializing it and trying to deploy it.  I have been unsuccessful so far and would like some hints.  Here's what i do right now:


  |          AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel);
  |          ObjectInputStream ois = new ObjectInputStream(url.openStream());
  |          KernelDeployment deployment = (KernelDeployment)ois.readObject();
  |          Field field = AbstractKernelDeployment.class.getDeclaredField("installedContexts");
  |          field.setAccessible(true);
  |          field.set(deployment, new CopyOnWriteArrayList<KernelControllerContext>());
  |          ois.close();
  |          deployer.deploy(deployment);
  | 

The "installedContexts" field of AbstractKernelDeployment is transient so I had to instantiate a new one and set the field or otherwise I would get an NPE.  Now, I'm finding that most of the beans, but not all, are NOT getting installed.  They are getting processed, but the state is ERROR condition.  The weird thing is that some of the beans are being installed correctly.  Any hints?



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

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



More information about the jboss-dev-forums mailing list