Index: nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java =================================================================== --- nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java (revision 51630) +++ nucleus/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java (working copy) @@ -410,13 +410,6 @@ context.getSource().setExtraData(Boolean.class, tempAppInfo.isJavaEEApp()); appRegistry.add(appName, tempAppInfo); - events.send(new Event(Deployment.DEPLOYMENT_BEFORE_CLASSLOADER_CREATION, context), false); - - context.createApplicationClassLoader(clh, handler); - if (tracing!=null) { - tracing.addMark(DeploymentTracing.Mark.CLASS_LOADER_CREATED); - } - try { notifyLifecycleInterceptorsBefore(ExtendedDeploymentContext.Phase.PREPARE, context); } catch(Throwable interceptorException) { @@ -427,6 +420,13 @@ return null; } + events.send(new Event(Deployment.DEPLOYMENT_BEFORE_CLASSLOADER_CREATION, context), false); + + context.createApplicationClassLoader(clh, handler); + if (tracing!=null) { + tracing.addMark(DeploymentTracing.Mark.CLASS_LOADER_CREATED); + } + // this is a first time deployment as opposed as load following an unload event, // we need to create the application info // todo : we should come up with a general Composite API solution