Hi all:
I've tested the new ContainerFactory when
deploying a bean without jboss.xml. It throws
ClassNotFoundExceptions. Reading the code I've
seen that package names are missing. Here is the
changes I've made...
When deploying a stateless session
-----------------------------------------------
// MF FIXME: We need to move this in the "conf" eventually that it comes
with defaults
try {
con.setContainerInvoker((ContainerInvoker)cl.loadClass(conf.getContainerInvoker()).newInstance());
con.setInstancePool((InstancePool)cl.loadClass(conf.getInstancePool()).newInstance());
}
catch (Exception e) {
// Something went wrong probably a configuration problem
log.log("Warning, Configuration Exception encountered, going to
default configuration!");
// Set the defaults for the stateless beans
con.setContainerInvoker((ContainerInvoker)
cl.loadClass("org.jboss.ejb.plugins.jrmp13.server.JRMPContainerInvoker").newInstance());
con.setInstancePool((InstancePool)
cl.loadClass("org.jboss.ejb.plugins.StatelessSessionInstancePool").newInstance());
}
-----------------------------------------------
And when deploying an entity
-----------------------------------------------
// MF FIXME: We need to move this in the "conf" eventually that it comes
with defaults
try {
con.setContainerInvoker((ContainerInvoker)cl.loadClass(conf.getContainerInvoker()).newInstance());
((EntityContainer)con).setInstanceCache((InstanceCache)cl.loadClass(conf.getInstanceCache()).newInstance());
con.setInstancePool((InstancePool)cl.loadClass(conf.getInstancePool()).newInstance());
((EntityContainer)con).setPersistenceManager((EntityPersistenceManager)cl.loadClass(conf.getPersistenceManager()).newInstance());
}
catch (Exception e) {
// Something went wrong probably a configuration problem
log.log("Warning, Configuration Exception encountered, going to
default configuration!");
// Set the defaults for the entity beans
con.setContainerInvoker((ContainerInvoker)
cl.loadClass("org.jboss.ejb.plugins.jrmp13.server.JRMPContainerInvoker").newInstance());
((EntityContainer)con).setInstanceCache((InstanceCache)
cl.loadClass("org.jboss.ejb.plugins.RandomEntityInstanceCache").newInstance());
con.setInstancePool((InstancePool)
cl.loadClass("org.jboss.ejb.plugins.EntityInstancePool").newInstance());
if (((jBossEntity) bean).getPersistenceType().equals("Bean")) {
((EntityContainer)con).setPersistenceManager((EntityPersistenceManager)
cl.loadClass("org.jboss.ejb.plugins.BMPPersistenceManager").newInstance());
}
else { // The bean is CMP
((EntityContainer)con).setPersistenceManager((EntityPersistenceManager)
cl.loadClass("org.jboss.ejb.plugins.CMPFilePersistenceManager").newInstance());
}
}
-----------------------------------------------
Rebuilding and trying to deploy the bean again...
it works ! :-)
Regards
Pedro
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]