Permalink
Browse files

Don't get the servlet context till after the deployment is started

  • Loading branch information...
1 parent 45a268b commit 2a040f2863db9b8ce34f12057d2b2cbe5e698ab5 @stuartwdouglas stuartwdouglas committed with kabir Mar 26, 2013
@@ -97,17 +97,17 @@ public void invoke(int state, InvocationContext context) {
switch (state) {
case Bundle.ACTIVE:
try {
- injectBundleContext(activator.getServletContext(), bundle.getBundleContext());
if (!activator.start(30, TimeUnit.SECONDS)) {
throw new LifecycleInterceptorException(OSGiMessages.MESSAGES.startContextFailed());
}
+ injectBundleContext(activator.getServletContext(), bundle.getBundleContext());
} catch (TimeoutException ex) {
throw new LifecycleInterceptorException(ex.getMessage(), ex);
}
break;
case Bundle.RESOLVED:
- activator.stop(30, TimeUnit.SECONDS);
uninjectBundleContext(activator.getServletContext());
+ activator.stop(30, TimeUnit.SECONDS);
break;
}
}

0 comments on commit 2a040f2

Please sign in to comment.