use of com.axway.ats.core.utils.ClasspathUtils in project ats-framework by Axway.
the class AgentWsContextListener method contextInitialized.
/*
* (non-Javadoc)
*
* @see
* javax.servlet.ServletContextListener#contextInitialized(javax.servlet
* .ServletContextEvent)
*/
@Override
public void contextInitialized(ServletContextEvent servletEvent) {
ServletContext servletContext = servletEvent.getServletContext();
servletContext.log("Servlet context initialized event is received. Starting registering configurators");
try {
new ClasspathUtils().logProblematicJars();
} catch (RuntimeException e) {
log.warn("Error caught while trying to get all JARs in classpath", e);
// do not rethrow exception as this will stop deployment on incompliant servers like JBoss
}
// create the default web service configurator
String pathToConfigFile = servletContext.getRealPath("/WEB-INF");
AgentConfigurator defaultConfigurator = new AgentConfigurator(pathToConfigFile);
TemplateActionsConfigurator templateActionsConfigurator = new TemplateActionsConfigurator(pathToConfigFile);
List<Configurator> configurators = new ArrayList<Configurator>();
configurators.add(defaultConfigurator);
configurators.add(templateActionsConfigurator);
log.info("Initializing ATS Agent web service, start component registration");
try {
MainComponentLoader.getInstance().initialize(configurators);
} catch (AgentException ae) {
throw new RuntimeException("Unable to initialize Agent component loader", ae);
}
}
Aggregations