Skip to content

Commit

Permalink
377492 NPE when deploying a Web Application Bundle with unresolved Re…
Browse files Browse the repository at this point in the history
…quire-TldBundle
  • Loading branch information
janbartel committed Apr 24, 2012
1 parent 0d68272 commit c4416e2
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -788,7 +788,7 @@ protected void configureWebappClassLoader(Bundle contributor, ContextHandler con
context.setClassLoader(webappClassLoader);
webappClassLoader.setWebappContext(webappCtxt);

String pathsToRequiredBundles = getPathsToRequiredBundles(context, requireTldBundle);
String pathsToRequiredBundles = getPathsToRequiredBundles(context, contributor, requireTldBundle);
if (pathsToRequiredBundles != null) webappClassLoader.addClassPath(pathsToRequiredBundles);
}
else
Expand Down Expand Up @@ -866,12 +866,11 @@ private void setThisBundleHomeProperty(Bundle bundle, HashMap<String, Object> pr
}
}

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();

Expand All @@ -884,7 +883,7 @@ private String getPathsToRequiredBundles(ContextHandler context, String requireT
+ "' 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)
Expand Down

0 comments on commit c4416e2

Please sign in to comment.