Commit 8f3ac8e2 authored by Yann Mombrun's avatar Yann Mombrun
Browse files

Fix solr start on windows.

Align new launcher version with previous one (looks like version used by LM was derived from 2.0.4-RC1).
Remove warnings.
Use new gate service

git-svn-id: svn://svn.forge.objectweb.org/svnroot/weblab/trunk/WebLabApplications/bundle@4285 a803c184-d8de-4a0e-a52b-d3eef88212b6
parent 7f74552a
...@@ -17,13 +17,15 @@ This bundle presents an information retrieval system based on the complete WebLa ...@@ -17,13 +17,15 @@ This bundle presents an information retrieval system based on the complete WebLa
It is mainly composed of the following WebLab servers: It is mainly composed of the following WebLab servers:
* apache-tomcat publishing web services * apache-tomcat publishing web services
* liferay publishing portlets * liferay publishing portlets
* customised karaf framework providing camel, activemq, web application and weblab features * solr enabling indexing/search of documents
* activemq providing JMS
* customised karaf framework providing camel, web application and weblab features
WebLab Bundle provide following tools open sources libraries as web services: WebLab Bundle provide following tools open sources libraries as web services:
* Gate : named entities extractor * Gate: named entities extractor
* Ngramj : a language detector * Ngramj: a language detector
* SolR indexer : a full text indexer/searcher * SolR indexer: a full text indexer/searcher
* Tika : a metadata extractor and normaliser for office documents * Tika: a metadata extractor and normaliser for office documents
and WebLab portlets: and WebLab portlets:
* a search portlet that will launch query with filters on the SolR searcher, * a search portlet that will launch query with filters on the SolR searcher,
...@@ -38,9 +40,9 @@ Processing chains: ...@@ -38,9 +40,9 @@ Processing chains:
Getting Started Getting Started
************************************************************************************** **************************************************************************************
You should have a jdk 1.7 or greater installed in order to run the WebLab bundle, You should have a jdk 1.8 or greater installed in order to run the WebLab bundle,
JAVA_HOME must be declared and java must be available in your path JAVA_HOME must be declared and java must be available in your path
Ports 8080, 8005, 8009 (Liferay), 8181, 8105, 8109 (Tomcat), 8282 (Jetty in Karaf), 61616 (ActiveMQ in Karaf) must be available. Ports 8080, 8005, 8009 (Liferay), 8181, 8105, 8109 (Tomcat), 8282 (Jetty in Karaf), 61616 (ActiveMQ), 8983 (Solr), 1099 (JMX for Karaf) must be available.
Your computer should have at least a 4 core processor and 6Go of RAM to run the WebLab bundle. Your computer should have at least a 4 core processor and 6Go of RAM to run the WebLab bundle.
Remember that WebLab is a server application and not a desktop one. Remember that WebLab is a server application and not a desktop one.
......
...@@ -93,10 +93,10 @@ ...@@ -93,10 +93,10 @@
</file> </file>
<!-- specific activeMQ conf file --> <!-- specific activeMQ conf file -->
<file> <file>
<source>../conf/activemq/activemq.xml</source> <source>../conf/activemq/activemq.xml</source>
<outputDirectory>${activemq.path}/conf/</outputDirectory> <outputDirectory>${activemq.path}/conf/</outputDirectory>
</file> </file>
<file> <file>
<!-- Add third party license --> <!-- Add third party license -->
...@@ -118,6 +118,8 @@ ...@@ -118,6 +118,8 @@
<include>org.apache.tomcat:tomcat:zip</include> <include>org.apache.tomcat:tomcat:zip</include>
<include>com.liferay:liferay-portal-tomcat:zip</include> <include>com.liferay:liferay-portal-tomcat:zip</include>
<include>org.ow2.weblab.osgi:karaf-weblab:tar.gz</include> <include>org.ow2.weblab.osgi:karaf-weblab:tar.gz</include>
<include>org.apache.activemq:activemq-bin:tar.gz</include>
<include>org.apache.solr:solr:tgz</include>
</includes> </includes>
<outputFileNameMapping>${artifact.artifactId}</outputFileNameMapping> <outputFileNameMapping>${artifact.artifactId}</outputFileNameMapping>
<unpack>true</unpack> <unpack>true</unpack>
...@@ -148,43 +150,14 @@ ...@@ -148,43 +150,14 @@
<exclude>${liferay.tomcat.path}/webapps/welcome-theme/</exclude> <exclude>${liferay.tomcat.path}/webapps/welcome-theme/</exclude>
<exclude>${liferay.tomcat.path}/webapps/marketplace-portlet/</exclude> <exclude>${liferay.tomcat.path}/webapps/marketplace-portlet/</exclude>
<exclude>${liferay.tomcat.path}/webapps/resources-importer-web/</exclude> <exclude>${liferay.tomcat.path}/webapps/resources-importer-web/</exclude>
</excludes>
</unpackOptions>
<fileMode>0755</fileMode>
</dependencySet>
<!-- Extract activemq server --> <!-- Disable default activemq conf -->
<dependencySet> <exclude>${activemq.path}/conf/activemq.xml</exclude>
<includes>
<include>org.apache.activemq:activemq-bin:tar.gz</include>
</includes>
<outputFileNameMapping>${artifact.artifactId}</outputFileNameMapping>
<outputDirectory>./</outputDirectory>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<!-- Disable default conf -->
<exclude>${activemq.path}/conf/activemq.xml</exclude>
</excludes>
</unpackOptions>
<fileMode>0755</fileMode> <!-- Disable default solr conf -->
</dependencySet> <exclude>${solr.path}/server/solr/solr.xml</exclude>
<!-- Extract solr server -->
<dependencySet>
<includes>
<include>org.apache.solr:solr:tgz</include>
</includes>
<outputDirectory>./</outputDirectory>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<!-- Disable default conf -->
<exclude>${solr.path}/server/solr/solr.xml</exclude>
</excludes> </excludes>
</unpackOptions> </unpackOptions>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
</dependencySet> </dependencySet>
...@@ -215,7 +188,7 @@ ...@@ -215,7 +188,7 @@
</unpackOptions> </unpackOptions>
</dependencySet> </dependencySet>
<!-- Put JTS topology jar into solr classpath (for geolocalistion) --> <!-- Put JTS topology jar into solr classpath (to enable geo based queries) -->
<dependencySet> <dependencySet>
<includes> <includes>
<include>com.vividsolutions:jts:jar:*</include> <include>com.vividsolutions:jts:jar:*</include>
......
...@@ -142,7 +142,6 @@ ...@@ -142,7 +142,6 @@
<feature>management</feature> <feature>management</feature>
<feature>obr</feature> <feature>obr</feature>
<feature>ssh</feature> <feature>ssh</feature>
<!--feature>activemq-broker</feature-->
<feature>camel</feature> <feature>camel</feature>
<feature>camel-core</feature> <feature>camel-core</feature>
<feature>camel-cxf</feature> <feature>camel-cxf</feature>
...@@ -161,6 +160,7 @@ ...@@ -161,6 +160,7 @@
</bootFeatures> </bootFeatures>
<installedFeatures> <installedFeatures>
<feature>activemq-broker</feature>
<feature>activemq-web-console</feature> <feature>activemq-web-console</feature>
<feature>aries-annotation</feature> <feature>aries-annotation</feature>
<feature>blueprint-web</feature> <feature>blueprint-web</feature>
......
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>libs</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>*:*:pom</exclude>
</excludes>
</dependencySet>
</dependencySets>
<files>
<file>
<source>log4j.properties</source>
</file>
</files>
</assembly>
# Solr is a bit verbose, oly warn to console and info to roling file.
# This could easily be changed
# Console appender limited to WARN
log4j.appender.console = org.apache.log4j.ConsoleAppender
log4j.appender.console.threshold = WARN
log4j.appender.console.encoding = UTF-8
log4j.appender.console.layout = org.apache.log4j.PatternLayout
log4j.appender.console.layout.conversionPattern = %d{ISO8601} %-5p %c - %m%n
# RollingFile appender limited to INFO
log4j.appender.rollingfile = org.apache.log4j.DailyRollingFileAppender
log4j.appender.rollingfile.threshold = INFO
log4j.appender.rollingfile.layout = org.apache.log4j.PatternLayout
log4j.appender.rollingfile.layout.conversionPattern = %d{ISO8601} %-5p %c - %m%n
log4j.appender.rollingfile.file = ${catalina.home}/logs/solr/solr.log
log4j.appender.rollingfile.append = true
log4j.appender.rollingfile.encoding = UTF-8
log4j.appender.rollingfile.datePattern = '.'yyyy-MM-dd
# Configuration of the Loggers
log4j.rootLogger = DEBUG, console, rollingfile
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.weblab.bundle</groupId>
<artifactId>parent</artifactId>
<version>2.0.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>solr-logging</artifactId>
<packaging>pom</packaging>
<name>SOLR Logging Libraries assembly.</name>
<description>Libraries to be added to solr dependencies to enable logging.</description>
<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf.version}</version>
</dependency>
</dependencies>
<build>
<finalName>solr-logging</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptor>assembly.xml</descriptor>
<finalName>solr-logging</finalName>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
...@@ -44,11 +44,6 @@ ...@@ -44,11 +44,6 @@
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>${log4j.version}</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.ow2.weblab.engines</groupId>
<artifactId>chain-interfaces</artifactId>
<version>1.1.0</version>
</dependency>
<dependency> <dependency>
<groupId>javax.jmdns</groupId> <groupId>javax.jmdns</groupId>
<artifactId>jmdns</artifactId> <artifactId>jmdns</artifactId>
......
...@@ -50,4 +50,10 @@ public final class Constants { ...@@ -50,4 +50,10 @@ public final class Constants {
public static final int OTHER_SERVER_FAILED = 8; public static final int OTHER_SERVER_FAILED = 8;
public static final int ACTIVEMQ_FAILED = 9;
public static final int SOLR_FAILED = 10;
} }
...@@ -57,6 +57,7 @@ public class Launcher { ...@@ -57,6 +57,7 @@ public class Launcher {
*/ */
public static WebLabBean configuration; public static WebLabBean configuration;
/** /**
* @param args * @param args
*/ */
...@@ -65,8 +66,8 @@ public class Launcher { ...@@ -65,8 +66,8 @@ public class Launcher {
// set weblab.home system property if not already defined // set weblab.home system property if not already defined
if (System.getProperty("weblab.home") == null) { if (System.getProperty("weblab.home") == null) {
System.setProperty("weblab.home", PathUtils.getWebLabHome("")); System.setProperty("weblab.home", PathUtils.getWebLabHome(""));
if (logger.isLoggable(Level.FINEST)) { if (Launcher.logger.isLoggable(Level.FINEST)) {
logger.finest("weblab.home system property not set, setting it at : " + PathUtils.getWebLabHome("")); Launcher.logger.finest("weblab.home system property not set, setting it at : " + PathUtils.getWebLabHome(""));
} }
} }
// set conf and data dir // set conf and data dir
...@@ -77,21 +78,21 @@ public class Launcher { ...@@ -77,21 +78,21 @@ public class Launcher {
// load configuration // load configuration
Launcher.configuration = Utils.loadConfiguration(); Launcher.configuration = Utils.loadConfiguration();
} catch (final Exception exception) { } catch (final Exception exception) {
logger.severe("Could not load configuration file. Make sure you neither make a mistake in configuration.xml nor forget to provide external libraries."); Launcher.logger.severe("Could not load configuration file. Make sure you neither make a mistake in configuration.xml nor forget to provide external libraries.");
logger.log(Level.SEVERE, exception.getMessage(), exception); Launcher.logger.log(Level.SEVERE, exception.getMessage(), exception);
end(Constants.COMMAND_FAILED); Launcher.end(Constants.COMMAND_FAILED);
} }
logger = Utils.getLogger(); Launcher.logger = Utils.getLogger();
// check if it is the first launch // check if it is the first launch
initChecks(); Launcher.initChecks();
logger.finest("Logger level : " + logger.getLevel()); Launcher.logger.finest("Logger level : " + Launcher.logger.getLevel());
logger.finest("Given args : " + args.length + " " + Arrays.asList(args)); Launcher.logger.finest("Given args : " + args.length + " " + Arrays.asList(args));
if (args.length < 1) { if (args.length < 1) {
end(Constants.COMMAND_FAILED); Launcher.end(Constants.COMMAND_FAILED);
} }
final String command = args[0]; final String command = args[0];
...@@ -105,31 +106,36 @@ public class Launcher { ...@@ -105,31 +106,36 @@ public class Launcher {
command3 = args[2]; command3 = args[2];
} }
final boolean force = parseArgs(args, "--force"); final boolean force = Launcher.parseArgs(args, "--force");
if (logger.isLoggable(Level.FINEST)) { if (Launcher.logger.isLoggable(Level.FINEST)) {
logger.finest("Loading Chain commander manager"); Launcher.logger.finest("Loading Chain commander manager");
} }
final ChainCommandManager chainManager = new ChainCommandManager(logger, configuration); final ChainCommandManager chainManager = new ChainCommandManager(Launcher.logger, Launcher.configuration);
if (logger.isLoggable(Level.FINEST)) { if (Launcher.logger.isLoggable(Level.FINEST)) {
logger.finest("Loading Servers commander manager"); Launcher.logger.finest("Loading Servers commander manager");
} }
final ServerManager serverManager = new ServerManager(logger, configuration); final ServerManager serverManager = new ServerManager(Launcher.logger, Launcher.configuration);
final Map<String, String> doc = serverManager.getServersCommands(); final Map<String, String> serverCommands = serverManager.getServersCommands();
// start all // start all
if ("start".equals(command)) { if ("start".equals(command)) {
check(); Launcher.check();
serverManager.start(Utils.getServer(logger, args)); serverManager.start(Utils.getServer(Launcher.logger, args));
} // end all } // end all
else if ("stop".equals(command)) { else if ("stop".equals(command)) {
serverManager.stop(Utils.getServer(logger, args), force); serverManager.stop(Utils.getServer(Launcher.logger, args), force);
} // Restart all
else if ("restart".equals(command)) {
serverManager.stop(Utils.getServer(Launcher.logger, args), force);
Launcher.check();
serverManager.start(Utils.getServer(Launcher.logger, args), Launcher.debug);
} // server specific command } // server specific command
else if (doc.keySet().contains(command)) { else if (serverCommands.keySet().contains(command)) {
if ("start".equals(command2)) { if ("start".equals(command2)) {
check(); Launcher.check();
serverManager.start(command); serverManager.start(command);
} else if ("stop".equals(command2)) { } else if ("stop".equals(command2)) {
serverManager.stop(command, force); serverManager.stop(command, force);
...@@ -144,23 +150,23 @@ public class Launcher { ...@@ -144,23 +150,23 @@ public class Launcher {
} else if ("chain".equals(command)) { } else if ("chain".equals(command)) {
chainManager.execute(command2, command3); chainManager.execute(command2, command3);
} else if ("details".equals(command)) { } else if ("details".equals(command)) {
help(true, doc); Launcher.help(true, serverCommands);
} else if ("help".equals(command) || "--help".equals(command)) { } else if ("help".equals(command) || "--help".equals(command)) {
help(false, null); Launcher.help(false, null);
} else if ("split".equals(command)) { } else if ("split".equals(command)) {
serverManager.split(); serverManager.split();
} else if ("master".equals(command)) { } else if ("master".equals(command)) {
ServerMonitor.master(logger, configuration); ServerMonitor.master(Launcher.logger, Launcher.configuration);
} else if ("monitor".equals(command)) { } else if ("monitor".equals(command)) {
ServerMonitor.monitor(serverManager, chainManager, Launcher.logger, Launcher.configuration, command2); ServerMonitor.monitor(serverManager, chainManager, Launcher.logger, Launcher.configuration, command2);
} else if ("cidre".equals(command)) { } else if ("cidre".equals(command)) {
Utils.reinit(logger); Utils.reinit(Launcher.logger);
} else if ("reset".equals(command)) { } else if ("reset".equals(command)) {
reset(); Launcher.reset();
} else if ("status".equals(command)) { } else if ("status".equals(command)) {
serverManager.status(null); serverManager.status(null);
} else { } else {
end(Constants.COMMAND_FAILED); Launcher.end(Constants.COMMAND_FAILED);
} }
} }
...@@ -278,30 +284,30 @@ public class Launcher { ...@@ -278,30 +284,30 @@ public class Launcher {
if (!pidsFile.exists()) { if (!pidsFile.exists()) {
// run processmanager to set rights to teh specified servers // run processmanager to set rights to teh specified servers
final ProcessManager procManager = ProcessManager.getInstance(); final ProcessManager procManager = ProcessManager.getInstance();
procManager.setPermission(PathUtils.getWebLabHome("conf"), "u+rx", true, logger); procManager.setPermission(PathUtils.getWebLabHome("conf"), "u+rx", true, Launcher.logger);
procManager.setPermission(PathUtils.getWebLabHome("data"), "u+rwx", true, logger); procManager.setPermission(PathUtils.getWebLabHome("data"), "u+rwx", true, Launcher.logger);
final TomcatServer applicationServer = Launcher.configuration.getApplicationServer(); final TomcatServer applicationServer = Launcher.configuration.getApplicationServer();
if (applicationServer != null && applicationServer.isEnabled() && applicationServer.getBinDirectory() != null) { if ((applicationServer != null) && applicationServer.isEnabled() && (applicationServer.getBinDirectory() != null)) {
procManager.setPermission(applicationServer.getBinDirectory(), "u+rx", true, logger); procManager.setPermission(applicationServer.getBinDirectory(), "u+rx", true, Launcher.logger);
} }
final TomcatServer portal = Launcher.configuration.getPortal(); final TomcatServer portal = Launcher.configuration.getPortal();
if (portal != null && portal.isEnabled() && portal.getBinDirectory() != null) { if ((portal != null) && portal.isEnabled() && (portal.getBinDirectory() != null)) {
procManager.setPermission(portal.getBinDirectory(), "u+rx", true, logger); procManager.setPermission(portal.getBinDirectory(), "u+rx", true, Launcher.logger);
} }
final Bus bus = Launcher.configuration.getBus(); final Bus bus = Launcher.configuration.getBus();
if (bus != null && bus.isEnabled() && bus.getBinDirectory() != null) { if ((bus != null) && bus.isEnabled() && (bus.getBinDirectory() != null)) {
procManager.setPermission(bus.getBinDirectory(), "u+rx", true, logger); procManager.setPermission(bus.getBinDirectory(), "u+rx", true, Launcher.logger);
} }
for (final WebLabServer server : Launcher.configuration.getServers()) { for (final WebLabServer server : Launcher.configuration.getServers()) {
if (server != null && server.isEnabled() && server.getBinDirectory() != null) { if ((server != null) && server.isEnabled() && (server.getBinDirectory() != null)) {
procManager.setPermission(server.getBinDirectory(), "u+rx", true, logger); procManager.setPermission(server.getBinDirectory(), "u+rx", true, Launcher.logger);
} }
} }
final String[] potentialExecutables = new String[] { Launcher.configuration.getResetScript(), PathUtils.getWebLabHome("weblab.sh"), PathUtils.getWebLabHome("weblab.bat"), final String[] potentialExecutables = new String[] { Launcher.configuration.getResetScript(), PathUtils.getWebLabHome("weblab.sh"), PathUtils.getWebLabHome("weblab.bat"),
PathUtils.getWebLabHome("weblab-launcher.jar"), PathUtils.createPath(PathUtils.getWebLabHome("data"), "lib") }; PathUtils.getWebLabHome("weblab-launcher.jar"), PathUtils.createPath(PathUtils.getWebLabHome("data"), "lib") };
for (final String exec : potentialExecutables) { for (final String exec : potentialExecutables) {
if (exec != null) { if (exec != null) {
procManager.setPermission(exec, "u+rx", true, logger); procManager.setPermission(exec, "u+rx", true, Launcher.logger);
} }
} }
......
...@@ -26,227 +26,298 @@ import org.ow2.weblab.bundle.server.WebLabServer; ...@@ -26,227 +26,298 @@ import org.ow2.weblab.bundle.server.WebLabServer;
/** /**
* WebLab configuration params * WebLab configuration params
*
* @author asaval * @author asaval
* *
*/ */
public class WebLabBean { public class WebLabBean {
private String name = "WebLab"; private String name = "WebLab";
private String debug = "info"; private String debug = "info";
// TODO remove ? // TODO remove ?
private String home = "info"; private String home = "info";
// TODO remove ? // TODO remove ?
private boolean jmxEnabled = true; private boolean jmxEnabled = true;