X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Fjava%2Forg%2Fmxchange%2Fpizzaapplication%2Fapplication%2FPizzaServiceApplication.java;h=d8253814c2c7a000741ccc59f10bb1774ccbd29c;hb=ad3a217eb62ab36fab7004786b42e44edc063171;hp=b81e142a635f910f33f657baf829a5e615d46bae;hpb=30e3c915cb945fd5bfc056892e05a2ebfedbaf5c;p=pizzaservice-war.git diff --git a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java index b81e142a..d8253814 100644 --- a/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java +++ b/src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java @@ -95,17 +95,18 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P instance = (PizzaApplication) object; // Debug message - instance.getLogger().debug(MessageFormat.format("Using existing instance {0} ...", object)); + instance.getLogger().debug(MessageFormat.format("Using existing instance {0} ...", object)); //NOI18N } else if (object instanceof Object) { // Not correct instance throw new ServletException("app is not set correctly"); //NOI18N } else { try { // "service" is null, so initialize it - instance = new PizzaServiceApplication(context); + instance = new PizzaServiceApplication(); + instance.init(context); // Debug message - instance.getLogger().debug(MessageFormat.format("Created new instance {0} ...", object)); + instance.getLogger().debug(MessageFormat.format("Created new instance {0} ...", object)); //NOI18N } catch (final UnsupportedDatabaseBackendException | SQLException | IOException | BadTokenException ex) { throw new ServletException(ex); } @@ -131,12 +132,8 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P new PizzaServiceApplication().start(); } - /** - * Constructor with servet configuration - * - * @param context Servlet context - */ - private PizzaServiceApplication (final ServletContext context) throws UnsupportedDatabaseBackendException, SQLException, IOException, BadTokenException { + @Override + public void init (final ServletContext context) throws UnsupportedDatabaseBackendException, SQLException, IOException, BadTokenException { // Temporary initialize default bundle // @TODO The JSF may have better internatialization support this.initBundle(); @@ -1171,7 +1168,10 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P try { // Init properties this.initProperties(); - } catch (final IOException ex) { + + // And frontends + this.initDatabaseFrontends(); + } catch (final IOException | UnsupportedDatabaseBackendException | SQLException ex) { // Abort here this.abortProgramWithException(ex); }