From: Jani Laakso Date: Tue, 13 Mar 2007 17:14:00 +0000 (+0000) Subject: Better exception reporting for first time users on cases where themes or license... X-Git-Tag: 6.7.0.beta1~6532 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=063b928e8fc3fbb7aa0bcf174fa59d953fc1adeb;p=vaadin-framework.git Better exception reporting for first time users on cases where themes or license file is missing or not installed properly. svn changeset:869/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/web/ApplicationServlet.java b/src/com/itmill/toolkit/terminal/web/ApplicationServlet.java index 4ebb10a480..3974eb98e9 100644 --- a/src/com/itmill/toolkit/terminal/web/ApplicationServlet.java +++ b/src/com/itmill/toolkit/terminal/web/ApplicationServlet.java @@ -314,7 +314,10 @@ public class ApplicationServlet extends HttpServlet implements // Check that at least one themesource was loaded if (this.themeSource.getThemes().size() <= 0) { throw new ServletException( - "No themes found in specified themesources."); + "No themes found in specified themesources. " + + "You can provide themes by e.g. adding " + + "itmill-toolkit-x.y.z-themes.jar " + + "to WEB-INF/lib directory."); } // Initialize the transformer factory, if not initialized @@ -1364,8 +1367,15 @@ public class ApplicationServlet extends HttpServlet implements if (!license.hasBeenRead()) { InputStream lis; try { - lis = getServletContext().getResource( - "/WEB-INF/itmill-toolkit-license.xml").openStream(); + URL url = getServletContext().getResource( + "/WEB-INF/itmill-toolkit-license.xml"); + if (url == null) { + throw new RuntimeException( + "License file could not be read. " + + "You can install it to " + + "WEB-INF/itmill-toolkit-license.xml."); + } + lis = url.openStream(); license.readLicenseFile(lis); } catch (MalformedURLException e) { // This should not happen