String mainClassName = getMainClassName(unit, true);
Class<?> mainClass = loadClass(unit, mainClassName);
ClientENCInjectionContainer container = new ClientENCInjectionContainer(unit, metaData, mainClass, appClientName, unit.getClassLoader(), encCtx, persistenceUnitDependencyResolver);
//di.deployedObject = container.getObjectName();
unit.addAttachment(ClientENCInjectionContainer.class, container);
JBoss5DeploymentUnit ejb3Unit = new JBoss5DeploymentUnit(unit);
getKernelAbstraction().install(container.getObjectName().getCanonicalName(),
container.getDependencyPolicy(), ejb3Unit, container);
}
catch(Exception e)
{
log.error("Could not deploy " + unit.getName(), e);
undeploy(unit, metaData);