Browse Source

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
tags/6.7.0.beta1
Jani Laakso 17 years ago
parent
commit
063b928e8f
1 changed files with 13 additions and 3 deletions
  1. 13
    3
      src/com/itmill/toolkit/terminal/web/ApplicationServlet.java

+ 13
- 3
src/com/itmill/toolkit/terminal/web/ApplicationServlet.java View File

// Check that at least one themesource was loaded // Check that at least one themesource was loaded
if (this.themeSource.getThemes().size() <= 0) { if (this.themeSource.getThemes().size() <= 0) {
throw new ServletException( 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 // Initialize the transformer factory, if not initialized
if (!license.hasBeenRead()) { if (!license.hasBeenRead()) {
InputStream lis; InputStream lis;
try { 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); license.readLicenseFile(lis);
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
// This should not happen // This should not happen

Loading…
Cancel
Save