From 6ab68f0dda616e25bd961c4cd4801895e960d21d Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Mon, 27 Aug 2012 18:12:44 +1000 Subject: [PATCH] 387943 Catch CNFE when no jstl jars are installed --- .../jasper/WebappRegistrationCustomizerImpl.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java index be599f50f4f..2d1cecd2bb2 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java +++ b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java @@ -139,17 +139,23 @@ public class WebappRegistrationCustomizerImpl implements WebappRegistrationCusto public URL[] getJarsWithTlds(DeploymentManager deployer, BundleFileLocatorHelper locatorHelper) throws Exception { + ArrayList urls = new ArrayList(); HashSet> classesToAddToTheTldBundles = new HashSet>(); // Look for the jstl bundle // We assume the jstl's tlds are defined there. // We assume that the jstl bundle is imported by this bundle // So we can look for this class using this bundle's classloader: - Class jstlClass = WebappRegistrationCustomizerImpl.class.getClassLoader().loadClass(DEFAULT_JSTL_BUNDLE_CLASS); + try + { + Class jstlClass = WebappRegistrationCustomizerImpl.class.getClassLoader().loadClass(DEFAULT_JSTL_BUNDLE_CLASS); - classesToAddToTheTldBundles.add(jstlClass); - - ArrayList urls = new ArrayList(); + classesToAddToTheTldBundles.add(jstlClass); + } + catch (ClassNotFoundException e) + { + LOG.info("jstl not on classpath", e); + } for (Class cl : classesToAddToTheTldBundles) { Bundle tldBundle = FrameworkUtil.getBundle(cl);