@Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {

        environment = LocalEnvironment.getInstance();

        // Read configuration information from GUACAMOLE_HOME/guacamole.properties
        try {
            File guacProperties = new File(environment.getGuacamoleHome(), "guacamole.properties");
            environment.addGuacamoleProperties(new FileGuacamoleProperties(guacProperties));
            logger.info("Read configuration parameters from \"{}\".", guacProperties);
        }
        catch (GuacamoleException e) {
            logger.error("Unable to read guacamole.properties: {}", e.getMessage());
            logger.debug("Error reading guacamole.properties.", e);
        }

        // For any values not defined in GUACAMOLE_HOME/guacamole.properties,
        // read from system environment if "enable-environment-properties" is
        // set to "true"
        try {
            if (environment.getProperty(ENABLE_ENVIRONMENT_PROPERTIES, false)) {
                environment.addGuacamoleProperties(new SystemEnvironmentGuacamoleProperties());
                logger.info("Additional configuration parameters may be read "
                        + "from environment variables.");
            }
        }
        catch (GuacamoleException e) {
            logger.error("Unable to configure support for environment properties: {}", e.getMessage());
            logger.debug("Error reading \"{}\" property from guacamole.properties.", ENABLE_ENVIRONMENT_PROPERTIES.getName(), e);
        }

        // For any values not defined in GUACAMOLE_HOME/guacamole.properties
        // nor in the system environment, read from files pointed to by
        // corresponding "*_FILE" variables in the system environment if
        // "enable-file-environment-properties" is set to "true"
        try {
            if (environment.getProperty(ENABLE_FILE_ENVIRONMENT_PROPERTIES, false)) {
                environment.addGuacamoleProperties(new SystemFileEnvironmentGuacamoleProperties());
                logger.info("Additional configuration parameters may be read "
                        + "from files pointed to by \"*_FILE\" environment "
                        + "variables.");
            }
        }
        catch (GuacamoleException e) {
            logger.error("Unable to configure support for file environment properties: {}", e.getMessage());
            logger.debug("Error reading \"{}\" property from guacamole.properties.", ENABLE_FILE_ENVIRONMENT_PROPERTIES.getName(), e);
        }

        // Now that at least the main guacamole.properties source of
        // configuration information is available, initialize the session map
        sessionMap = new HashTokenSessionMap(environment);

        // NOTE: The superclass implementation of contextInitialized() is
        // expected to invoke getInjector(), hence the need to call AFTER
        // setting up the environment and session map
        super.contextInitialized(servletContextEvent);

        // Inject any annotated members of this class
        Injector injector = getInjector();
        injector.injectMembers(this);

        // Store reference to injector for use by Jersey and HK2 bridge
        servletContextEvent.getServletContext().setAttribute(GUICE_INJECTOR, injector);

        // Inform any listeners that application startup has completed
        try {
            listenerService.handleEvent(new ApplicationStartedEvent() {
                // The application startup event currently has no content
            });
        }
        catch (GuacamoleException e) {
            logger.error("An extension listening for application startup failed: {}", e.getMessage());
            logger.debug("Extension failed internally while handling the application startup event.", e);
        }

    }
Internal reference to the Guice injector that was lazily created when
getInjector() was first invoked.
guacamole/src/main/java/org/apache/guacamole/GuacamoleServletContextListener.java