From 8d18642311e8d0225332277aa6da856cbdbc325d Mon Sep 17 00:00:00 2001 From: Hugues Malphettes Date: Fri, 17 Jun 2011 04:14:08 +0000 Subject: [PATCH] Better error messages when web-buindles fail to start cleanly. git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3392 7e9141cc-0065-0410-87d8-b60c137991c4 --- jetty-osgi/jetty-osgi-boot/META-INF/MANIFEST.MF | 2 +- .../boot/internal/webapp/WebBundleTrackerCustomizer.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jetty-osgi/jetty-osgi-boot/META-INF/MANIFEST.MF b/jetty-osgi/jetty-osgi-boot/META-INF/MANIFEST.MF index 63802adc78d..e7dfce0738a 100644 --- a/jetty-osgi/jetty-osgi-boot/META-INF/MANIFEST.MF +++ b/jetty-osgi/jetty-osgi-boot/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Jetty OSGi bootstrap Bundle-SymbolicName: org.eclipse.jetty.osgi.boot;singleton:=true Bundle-Vendor: Mort Bay Consulting -Bundle-Version: 7.4.1.qualifier +Bundle-Version: 7.4.3.qualifier Bundle-Activator: org.eclipse.jetty.osgi.boot.JettyBootstrapActivator Import-Package: javax.mail;version="1.4.0";resolution:=optional, javax.mail.event;version="1.4.0";resolution:=optional, diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java index e5cb24c8ad0..ca0c099050a 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java @@ -152,7 +152,10 @@ public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer { String contextPath = getWebContextPath(bundle, dic, false);//(String)dic.get(OSGiWebappConstants.RFC66_WEB_CONTEXTPATH); if (contextPath == null || !contextPath.startsWith("/")) { - throw new IllegalArgumentException(); + Log.warn("The manifest header '" + OSGiWebappConstants.JETTY_WAR_FOLDER_PATH + + ": " + warFolderRelativePath + "' in the bundle " + bundle.getSymbolicName() + + " is not valid: there is no Web-ContextPath defined in the manifest."); + return false; } // create the corresponding service and publish it in the context of // the contributor bundle. @@ -163,8 +166,7 @@ public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer { } catch (Throwable e) { - // TODO Auto-generated catch block - e.printStackTrace(); + Log.warn("Staring the web-bundle " + bundle.getSymbolicName() + " threw an exception.", e); return true;//maybe it did not work maybe it did. safer to track this bundle. } }