use of com.predic8.membrane.servlet.config.spring.BaseLocationXmlWebApplicationContext in project service-proxy by membrane.
the class MembraneServletContextListener method contextInitialized.
public void contextInitialized(ServletContextEvent sce) {
try {
log.info(Constants.PRODUCT_NAME + " starting...");
log.debug("loading proxies configuration from: " + getProxiesXmlLocation(sce));
appCtx = new BaseLocationXmlWebApplicationContext();
Router router = RouterUtil.initializeRoutersFromSpringWebContext(appCtx, sce.getServletContext(), getProxiesXmlLocation(sce));
if (router != null)
throw new RuntimeException("A <router> with a <servletTransport> cannot be used with MembraneServletContextListener. Use MembraneServlet instead.");
log.info(Constants.PRODUCT_NAME + " running.");
} catch (Exception ex) {
log.error("Router not started!", ex);
throw new RuntimeException("Router not started!", ex);
}
}
use of com.predic8.membrane.servlet.config.spring.BaseLocationXmlWebApplicationContext in project service-proxy by membrane.
the class MembraneServlet method init.
@Override
public void init(ServletConfig config) throws ServletException {
try {
appCtx = new BaseLocationXmlWebApplicationContext();
log.debug("loading beans configuration from: " + getProxiesXmlLocation(config));
router = RouterUtil.initializeRoutersFromSpringWebContext(appCtx, config.getServletContext(), getProxiesXmlLocation(config));
if (router == null)
throw new RuntimeException("No <router> with a <servletTransport> was found. To use <router> with <transport>, use MembraneServletContextListener instead of MembraneServlet.");
} catch (Exception e) {
throw new ServletException(e);
}
}
Aggregations