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
It is mainly composed of the following WebLab servers:
* apache-tomcat publishing web services
* 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:
* Gate : named entities extractor
* Ngramj : a language detector
* SolR indexer : a full text indexer/searcher
* Tika : a metadata extractor and normaliser for office documents
* Gate: named entities extractor
* Ngramj: a language detector
* SolR indexer: a full text indexer/searcher
* Tika: a metadata extractor and normaliser for office documents
and WebLab portlets:
* a search portlet that will launch query with filters on the SolR searcher,
......@@ -38,9 +40,9 @@ Processing chains:
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
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.
Remember that WebLab is a server application and not a desktop one.
......
......@@ -118,6 +118,8 @@
<include>org.apache.tomcat:tomcat:zip</include>
<include>com.liferay:liferay-portal-tomcat:zip</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>
<outputFileNameMapping>${artifact.artifactId}</outputFileNameMapping>
<unpack>true</unpack>
......@@ -148,43 +150,14 @@
<exclude>${liferay.tomcat.path}/webapps/welcome-theme/</exclude>
<exclude>${liferay.tomcat.path}/webapps/marketplace-portlet/</exclude>
<exclude>${liferay.tomcat.path}/webapps/resources-importer-web/</exclude>
</excludes>
</unpackOptions>
<fileMode>0755</fileMode>
</dependencySet>
<!-- Extract activemq server -->
<dependencySet>
<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 -->
<!-- Disable default activemq conf -->
<exclude>${activemq.path}/conf/activemq.xml</exclude>
</excludes>
</unpackOptions>
<fileMode>0755</fileMode>
</dependencySet>
<!-- Extract solr server -->
<dependencySet>
<includes>
<include>org.apache.solr:solr:tgz</include>
</includes>
<outputDirectory>./</outputDirectory>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<!-- Disable default conf -->
<!-- Disable default solr conf -->
<exclude>${solr.path}/server/solr/solr.xml</exclude>
</excludes>
</unpackOptions>
<fileMode>0755</fileMode>
</dependencySet>
......@@ -215,7 +188,7 @@
</unpackOptions>
</dependencySet>
<!-- Put JTS topology jar into solr classpath (for geolocalistion) -->
<!-- Put JTS topology jar into solr classpath (to enable geo based queries) -->
<dependencySet>
<includes>
<include>com.vividsolutions:jts:jar:*</include>
......
......@@ -142,7 +142,6 @@
<feature>management</feature>
<feature>obr</feature>
<feature>ssh</feature>
<!--feature>activemq-broker</feature-->
<feature>camel</feature>
<feature>camel-core</feature>
<feature>camel-cxf</feature>
......@@ -161,6 +160,7 @@
</bootFeatures>
<installedFeatures>
<feature>activemq-broker</feature>
<feature>activemq-web-console</feature>
<feature>aries-annotation</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 @@
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.weblab.engines</groupId>
<artifactId>chain-interfaces</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>javax.jmdns</groupId>
<artifactId>jmdns</artifactId>
......
......@@ -50,4 +50,10 @@ public final class Constants {
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 {
*/
public static WebLabBean configuration;
/**
* @param args
*/
......@@ -65,8 +66,8 @@ public class Launcher {
// set weblab.home system property if not already defined
if (System.getProperty("weblab.home") == null) {
System.setProperty("weblab.home", PathUtils.getWebLabHome(""));
if (logger.isLoggable(Level.FINEST)) {
logger.finest("weblab.home system property not set, setting it at : " + PathUtils.getWebLabHome(""));
if (Launcher.logger.isLoggable(Level.FINEST)) {
Launcher.logger.finest("weblab.home system property not set, setting it at : " + PathUtils.getWebLabHome(""));
}
}
// set conf and data dir
......@@ -77,21 +78,21 @@ public class Launcher {
// load configuration
Launcher.configuration = Utils.loadConfiguration();
} 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.");
logger.log(Level.SEVERE, exception.getMessage(), exception);
end(Constants.COMMAND_FAILED);
Launcher.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.log(Level.SEVERE, exception.getMessage(), exception);
Launcher.end(Constants.COMMAND_FAILED);
}
logger = Utils.getLogger();
Launcher.logger = Utils.getLogger();
// check if it is the first launch
initChecks();
Launcher.initChecks();
logger.finest("Logger level : " + logger.getLevel());
logger.finest("Given args : " + args.length + " " + Arrays.asList(args));
Launcher.logger.finest("Logger level : " + Launcher.logger.getLevel());
Launcher.logger.finest("Given args : " + args.length + " " + Arrays.asList(args));
if (args.length < 1) {
end(Constants.COMMAND_FAILED);
Launcher.end(Constants.COMMAND_FAILED);
}
final String command = args[0];
......@@ -105,31 +106,36 @@ public class Launcher {
command3 = args[2];
}
final boolean force = parseArgs(args, "--force");
final boolean force = Launcher.parseArgs(args, "--force");
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Loading Chain commander manager");
if (Launcher.logger.isLoggable(Level.FINEST)) {
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)) {
logger.finest("Loading Servers commander manager");
if (Launcher.logger.isLoggable(Level.FINEST)) {
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
if ("start".equals(command)) {
check();
serverManager.start(Utils.getServer(logger, args));
Launcher.check();
serverManager.start(Utils.getServer(Launcher.logger, args));
} // end all
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
else if (doc.keySet().contains(command)) {
else if (serverCommands.keySet().contains(command)) {
if ("start".equals(command2)) {
check();
Launcher.check();
serverManager.start(command);
} else if ("stop".equals(command2)) {
serverManager.stop(command, force);
......@@ -144,23 +150,23 @@ public class Launcher {
} else if ("chain".equals(command)) {
chainManager.execute(command2, command3);
} else if ("details".equals(command)) {
help(true, doc);
Launcher.help(true, serverCommands);
} else if ("help".equals(command) || "--help".equals(command)) {
help(false, null);
Launcher.help(false, null);
} else if ("split".equals(command)) {
serverManager.split();
} else if ("master".equals(command)) {
ServerMonitor.master(logger, configuration);
ServerMonitor.master(Launcher.logger, Launcher.configuration);
} else if ("monitor".equals(command)) {
ServerMonitor.monitor(serverManager, chainManager, Launcher.logger, Launcher.configuration, command2);
} else if ("cidre".equals(command)) {
Utils.reinit(logger);
Utils.reinit(Launcher.logger);
} else if ("reset".equals(command)) {
reset();
Launcher.reset();
} else if ("status".equals(command)) {
serverManager.status(null);
} else {
end(Constants.COMMAND_FAILED);
Launcher.end(Constants.COMMAND_FAILED);
}
}
......@@ -278,30 +284,30 @@ public class Launcher {
if (!pidsFile.exists()) {
// run processmanager to set rights to teh specified servers
final ProcessManager procManager = ProcessManager.getInstance();
procManager.setPermission(PathUtils.getWebLabHome("conf"), "u+rx", true, logger);
procManager.setPermission(PathUtils.getWebLabHome("data"), "u+rwx", true, logger);
procManager.setPermission(PathUtils.getWebLabHome("conf"), "u+rx", true, Launcher.logger);
procManager.setPermission(PathUtils.getWebLabHome("data"), "u+rwx", true, Launcher.logger);
final TomcatServer applicationServer = Launcher.configuration.getApplicationServer();
if (applicationServer != null && applicationServer.isEnabled() && applicationServer.getBinDirectory() != null) {
procManager.setPermission(applicationServer.getBinDirectory(), "u+rx", true, logger);
if ((applicationServer != null) && applicationServer.isEnabled() && (applicationServer.getBinDirectory() != null)) {
procManager.setPermission(applicationServer.getBinDirectory(), "u+rx", true, Launcher.logger);
}
final TomcatServer portal = Launcher.configuration.getPortal();
if (portal != null && portal.isEnabled() && portal.getBinDirectory() != null) {
procManager.setPermission(portal.getBinDirectory(), "u+rx", true, logger);
if ((portal != null) && portal.isEnabled() && (portal.getBinDirectory() != null)) {
procManager.setPermission(portal.getBinDirectory(), "u+rx", true, Launcher.logger);
}
final Bus bus = Launcher.configuration.getBus();
if (bus != null && bus.isEnabled() && bus.getBinDirectory() != null) {
procManager.setPermission(bus.getBinDirectory(), "u+rx", true, logger);
if ((bus != null) && bus.isEnabled() && (bus.getBinDirectory() != null)) {
procManager.setPermission(bus.getBinDirectory(), "u+rx", true, Launcher.logger);
}
for (final WebLabServer server : Launcher.configuration.getServers()) {
if (server != null && server.isEnabled() && server.getBinDirectory() != null) {
procManager.setPermission(server.getBinDirectory(), "u+rx", true, logger);
if ((server != null) && server.isEnabled() && (server.getBinDirectory() != null)) {
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"),
PathUtils.getWebLabHome("weblab-launcher.jar"), PathUtils.createPath(PathUtils.getWebLabHome("data"), "lib") };
for (final String exec : potentialExecutables) {
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;
/**
* WebLab configuration params
*
* @author asaval
*
*/
public class WebLabBean {
private String name = "WebLab";
private String debug = "info";
// TODO remove ?
private String home = "info";
// TODO remove ?
private boolean jmxEnabled = true;
private float classVersion = 51.0f;
private MonitoringBean monitoring = new MonitoringBean();
private boolean remoteAccess = false;
private String remoteLogin = "weblab";
private String remotePassword = "weblab";
// TODO remove ?
private String repository = "weblab";
private boolean servicesReconfigure = true;
// TODO remove ?
private String solrData = "";
private String split = "";
private long timeout = 300000;
private String toindex = "data/toIndex";
private String warcs= "data/warcs";
private String warcs = "data/warcs";
private String webdavPassword = "demo";
private String webdavUrl = null;
private String webdavUser = "demo@weblab-project.org";
private String resetScript;
private String chainManagerService;
private List<WebLabServer> servers = new LinkedList<WebLabServer>();
private List<WebLabServer> servers = new LinkedList<>();
private TomcatServer portal;
private Bus bus;
private WebLabServer activeMQServer;
private WebLabServer solrServer;
private TomcatServer applicationServer;
public String getDebug() {
return this.debug;
}
public void setDebug(final String debug) {
this.debug = debug;
}
public String getHome() {
return this.home;
}
public void setHome(final String home) {
this.home = home;
}
public float getClassVersion() {
return this.classVersion;
}
public void setClassVersion(float classVersion) {
public void setClassVersion(final float classVersion) {
this.classVersion = classVersion;
}
public boolean isJmxEnabled() {
return this.jmxEnabled;
}
public void setJmxEnabled(final boolean jmxEnabled) {
this.jmxEnabled = jmxEnabled;
}
public MonitoringBean getMonitoring() {
return this.monitoring;
}
public void setMonitoring(MonitoringBean monitoring) {
public void setMonitoring(final MonitoringBean monitoring) {
this.monitoring = monitoring;
}
public boolean isRemoteAccess() {
return this.remoteAccess;
}
public void setRemoteAccess(final boolean remoteAccess) {
this.remoteAccess = remoteAccess;
}
public String getRemoteLogin() {
return this.remoteLogin;