]> source.dussan.org Git - vaadin-framework.git/commitdiff
Better exception reporting for first time users on cases where themes or license...
authorJani Laakso <jani.laakso@itmill.com>
Tue, 13 Mar 2007 17:14:00 +0000 (17:14 +0000)
committerJani Laakso <jani.laakso@itmill.com>
Tue, 13 Mar 2007 17:14:00 +0000 (17:14 +0000)
svn changeset:869/svn branch:trunk

src/com/itmill/toolkit/terminal/web/ApplicationServlet.java

index 4ebb10a4801556043c5319281c43574bca0c8b6b..3974eb98e9d963c6f449ca92f203bdac44f3e451 100644 (file)
@@ -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