diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleDeployerHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleDeployerHelper.java index 67f5ccb17fd..b49949bd068 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleDeployerHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleDeployerHelper.java @@ -788,7 +788,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper context.setClassLoader(webappClassLoader); webappClassLoader.setWebappContext(webappCtxt); - String pathsToRequiredBundles = getPathsToRequiredBundles(context, requireTldBundle); + String pathsToRequiredBundles = getPathsToRequiredBundles(context, contributor, requireTldBundle); if (pathsToRequiredBundles != null) webappClassLoader.addClassPath(pathsToRequiredBundles); } else @@ -866,12 +866,11 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper } } - private String getPathsToRequiredBundles(ContextHandler context, String requireTldBundle) throws Exception + private String getPathsToRequiredBundles(ContextHandler context, Bundle bundle, String requireTldBundle) throws Exception { if (requireTldBundle == null) return null; StringBuilder paths = new StringBuilder(); - Bundle bundle = (Bundle) context.getAttribute(OSGiWebappConstants.JETTY_OSGI_BUNDLE); PackageAdmin packAdmin = getBundleAdmin(); DefaultFileLocatorHelper fileLocatorHelper = new DefaultFileLocatorHelper(); @@ -884,7 +883,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper + "' specified in the " + OSGiWebappConstants.REQUIRE_TLD_BUNDLE + " of the manifest of " - + bundle.getSymbolicName()); } + + (bundle==null?"unknown":bundle.getSymbolicName())); } File f = fileLocatorHelper.getBundleInstallLocation(bs[0]); if (paths.length() > 0)