} catch (MalformedObjectNameException e) {
throw new DeploymentException("Could not construct module name", e);
}
// create a gbean for the app client module and add it to the ear
ReadOnlyContext componentContext;
GBeanMBean appClientModuleGBean = new GBeanMBean(J2EEAppClientModuleImpl.GBEAN_INFO, earClassLoader);
try {
appClientModuleGBean.setReferencePatterns("J2EEServer", Collections.singleton(earContext.getServerObjectName()));
if (!earContext.getJ2EEApplicationName().equals("null")) {
appClientModuleGBean.setReferencePatterns("J2EEApplication", Collections.singleton(earContext.getApplicationObjectName()));