} catch (ConfigurationAlreadyExistsException e) {
throw new DeploymentException(e);
}
// construct the app client deployment context... this is the same class used by the ear context
EARContext appClientDeploymentContext;
try {
appClientDeploymentContext = new EARContext(appClientDir,
null,
clientEnvironment,
ConfigurationModuleType.CAR,
earContext.getNaming(),
earContext.getConfigurationManager(),
null, //no server name needed on client
appClientModule.getAppClientName(),
transactionManagerObjectName,
connectionTrackerObjectName,
null,
null,
corbaGBeanObjectName
);
appClientModule.setEarContext(appClientDeploymentContext);
appClientModule.setRootEarContext(earContext);
// extract the app client jar file into a standalone packed jar file and add the contents to the output
// JarFile moduleFile = module.getModuleFile();
try {
appClientDeploymentContext.addIncludeAsPackedJar(URI.create(module.getTargetPath()), moduleFile);
} catch (IOException e) {
throw new DeploymentException("Unable to copy app client module jar into configuration: " + moduleFile.getName());
}
EARConfigBuilder.LibClasspath libClasspath = (EARConfigBuilder.LibClasspath) earContext.getGeneralData().get(EARConfigBuilder.LibClasspath.class);
if (libClasspath != null) {
for (String libEntryPath: libClasspath) {
try {
NestedJarFile library = new NestedJarFile(earFile, libEntryPath);
appClientDeploymentContext.addIncludeAsPackedJar(URI.create(libEntryPath), library);
} catch (IOException e) {
throw new DeploymentException("Could not add to app client library classpath: " + libEntryPath, e);
}
}
}