org.argeo.node.repo.jackrabbit,\
org.argeo.security.dao.os,\
-#org.argeo.dep.osgi.catalina.start,\
+#org.argeo.server.catalina.start,\
#org.springframework.osgi.web.extender,\
#org.argeo.jackrabbit.webapp,\
argeo.osgi.start.4.node=\
org.argeo.jackrabbit.webapp,\
org.argeo.server.rap.webapp,\
-org.argeo.dep.osgi.catalina.start,\
+org.argeo.server.catalina.start,\
org.eclipse.equinox.http.registry,\
org.springframework.osgi.web.extender,\
#org.argeo.security.ui.initialPerspective=org.argeo.jcr.ui.explorer.perspective
log4j.configuration=file:../../log4j.properties
+argeo.server.tomcat.config=file:../../tomcat-server-ssl.xml
argeo.i18n.availableLocales=en,fr,de,ru,ar
eclipse.registry.MultiLanguage=true
--- /dev/null
+<?xml version='1.0' encoding='utf-8'?>
+<Server port="-1" shutdown="SHUTDOWN">
+ <!--APR library loader. Documentation at /docs/apr.html -->
+ <!-- <Listener className="org.apache.catalina.core.AprLifecycleListener"
+ SSLEngine="on" /> -->
+ <!-- Initialize Jasper prior to webapps are loaded. -->
+ <Listener className="org.apache.catalina.core.JasperListener" />
+ <!-- JMX -->
+ <!-- <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
+ /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
+ /> -->
+
+ <Service name="Catalina">
+ <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
+ maxThreads="150" minSpareThreads="4" />
+
+ <!-- HTTP -->
+ <Connector executor="tomcatThreadPool" port="${argeo.server.port.http}"
+ protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="${argeo.server.port.https}"
+ secure="${argeo.server.http.secure}" proxyName="${argeo.server.http.proxyName}"
+ proxyPort="${argeo.server.http.proxyPort}" />
+ <!-- HTTPS -->
+ <Connector port="${argeo.server.port.https}" protocol="HTTP/1.1"
+ SSLEnabled="true" scheme="https" secure="true" sslProtocol="TLS"
+ keystoreFile="${argeo.server.keystoreFile}" keystoreType="JKS"
+ keystorePass="${argeo.server.keystorePass}" truststoreFile="${argeo.server.truststoreFile}"
+ truststoreType="JKS" truststorePass="${argeo.server.truststorePass}"
+ clientAuth="${argeo.server.https.clientAuth}" />
+
+ <!-- AJP (for proxying with httpd) -->
+ <Connector port="${argeo.server.port.ajp}" protocol="AJP/1.3"
+ redirectPort="${argeo.server.port.https}" />
+
+ <Engine name="Catalina" defaultHost="localhost">
+ <Host name="localhost" appBase="webapps" unpackWARs="true"
+ autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"
+ workDir="work">
+ </Host>
+ </Engine>
+ </Service>
+</Server>
\ No newline at end of file
<version>2.2</version>
</extension>
</extensions>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>plugin.xml</include>
+ <include>META-INF/**</include>
+ <include>WEB-INF/**</include>
+ <include>icons/**</include>
+ <include>branding/**</include>
+ <include>*.properties</include>
+ <include>properties/*.properties</include>
+ <include>p2.inf</include>
+ </includes>
+ <excludes>
+ <exclude>build.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
<pluginManagement>
<plugins>
<!-- Maven -->
</plugin>
</plugins>
</pluginManagement>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>.</directory>
- <includes>
- <include>plugin.xml</include>
- <include>META-INF/**</include>
- <include>WEB-INF/**</include>
- <include>icons/**</include>
- <include>branding/**</include>
- <include>*.properties</include>
- <include>properties/*.properties</include>
- <include>p2.inf</include>
- </includes>
- <excludes>
- <exclude>build.properties</exclude>
- </excludes>
- </resource>
- </resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<version>1.1.9-SNAPSHOT</version>
</dependency>
- <!-- Default Tomcat conf -->
- <dependency>
- <groupId>org.argeo.commons.server</groupId>
- <artifactId>org.argeo.server.tomcat</artifactId>
- <version>1.1.9-SNAPSHOT</version>
- </dependency>
-
<!-- DB drivers -->
<dependency>
<groupId>org.argeo.tp</groupId>
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><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">
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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.argeo.commons.server</groupId>
<artifactId>org.argeo.server.catalina</artifactId>
<version>1.1.9-SNAPSHOT</version>
</dependency>
-<!-- <dependency> -->
-<!-- <groupId>org.argeo.commons.server</groupId> -->
-<!-- <artifactId>org.argeo.server.tomcat</artifactId> -->
-<!-- <version>0.3.1-SNAPSHOT</version> -->
-<!-- </dependency> -->
+ <dependency>
+ <groupId>org.argeo.commons.server</groupId>
+ <artifactId>org.argeo.server.catalina.start</artifactId>
+ <version>1.1.9-SNAPSHOT</version>
+ </dependency>
<!-- JEE -->
<dependency>
</dependency>
<!-- Tomcat -->
- <dependency>
- <groupId>org.argeo.tp</groupId>
- <artifactId>org.argeo.dep.osgi.catalina.start</artifactId>
- </dependency>
<dependency>
<groupId>org.argeo.tp</groupId>
<artifactId>org.apache.coyote</artifactId>
<artifactId>org.apache.xmlcommons</artifactId>
<scope>test</scope>
</dependency>
-
- <!-- OSGi test -->
- <dependency>
- <groupId>org.argeo.commons.base</groupId>
- <artifactId>org.argeo.osgi.boot</artifactId>
- <version>1.1.9-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
+
+ <!-- OSGi test -->
+ <dependency>
+ <groupId>org.argeo.commons.base</groupId>
+ <artifactId>org.argeo.osgi.boot</artifactId>
+ <version>1.1.9-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
</project>
\ No newline at end of file
-<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">
+<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.argeo.commons.server</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <Fragment-Host>org.argeo.dep.osgi.catalina.start</Fragment-Host>
+ <Fragment-Host>org.argeo.catalina.start</Fragment-Host>
</instructions>
</configuration>
</plugin>
<module>org.argeo.server.catalina</module>
<module>org.argeo.server.jdbc</module>
<module>org.argeo.server.rap.webapp</module>
- <module>org.argeo.server.tomcat</module>
+<!-- <module>org.argeo.server.tomcat</module> -->
</modules>
<build>
<resources>
-Bundle-Activator: org.argeo.dep.osgi.catalina.start.CatalinaActivator\r
-Created-By: Argeo\r
-Import-Package: javax.management;resolution:=optional,\r
- org.apache.catalina,\r
- org.apache.catalina.connector,\r
- org.apache.catalina.core,\r
- org.apache.catalina.startup,\r
- org.apache.catalina.util,\r
- org.apache.commons.io,\r
- org.apache.commons.logging;resolution:=optional,\r
- org.apache.naming.resources,\r
- org.osgi.framework;version="1.3",\r
- org.osgi.service.url;version="1.0"\r
-Bundle-Version: 1.0.0.0009\r
-Bundle-Name: Tomcat Catalina OSGi Activator (Argeo)\r
-Bundle-Description: Tomcat Catalina OSGi Activator with Argeo addons\r
-Bundle-SymbolicName: org.argeo.dep.osgi.catalina.start\r
-Bundle-RequiredExecutionEnvironment: J2SE-1.5\r
+Manifest-Version: 1.0\r
+Bnd-LastModified: 1355222632573\r
+Build-Jdk: 1.6.0_24\r
+Built-By: mbaudier\r
+Bundle-Activator: org.argeo.catalina.start.CatalinaActivator\r
+Bundle-Description: Catalina starter hacked from Spring DM sandbox\r
+Bundle-DocURL: http://www.argeo.org\r
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt\r
+Bundle-ManifestVersion: 2\r
+Bundle-Name: Commons Catalina starter\r
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6\r
+Bundle-SymbolicName: org.argeo.server.catalina.start\r
+Bundle-Vendor: Argeo\r
+Bundle-Version: 1.1.9.SNAPSHOT-r121211_1143\r
+Created-By: Apache Maven Bundle Plugin\r
+Export-Package: org.argeo.catalina.start;uses:="org.osgi.framework,org.a\r
+ pache.commons.io";version="1.1.9.SNAPSHOT-r121211_1143"\r
+Import-Package: javax.management;version="0.0.0",org.apache.catalina;ver\r
+ sion="[6.0,7)",org.apache.catalina.connector;version="[6.0,7)",org.apac\r
+ he.catalina.core;version="[6.0,7)",org.apache.catalina.startup;version=\r
+ "[6.0,7)",org.apache.catalina.util;version="[6.0,7)",org.apache.commons\r
+ .io;version="[1.4,2)",org.apache.commons.logging;version="[1.1,2)",org.\r
+ apache.naming.resources;version="[6.0,7)",org.osgi.framework;version="[\r
+ 1.5,2)",org.osgi.service.url;version="[1.0,2)"\r
+SLC-GroupId: org.argeo.commons.server\r
+Tool: Bnd-1.50.0\r
<parent>
<groupId>org.argeo.commons.server</groupId>
<version>1.1.9-SNAPSHOT</version>
- <artifactId>modules</artifactId>
+ <artifactId>runtime</artifactId>
<relativePath>..</relativePath>
</parent>
<artifactId>org.argeo.server.catalina.start</artifactId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <Bundle-Activator>org.argeo.dep.osgi.catalina.start.CatalinaActivator</Bundle-Activator>
+ <Bundle-Activator>org.argeo.catalina.start.CatalinaActivator</Bundle-Activator>
+ <Import-Package>
+ javax.management;version="0.0.0",
+ *
+ </Import-Package>
</instructions>
</configuration>
</plugin>
</build>
<dependencies>
<dependency>
- <groupId>org.eclipse.osgi</groupId>
+ <groupId>org.argeo.tp</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
--- /dev/null
+package org.argeo.catalina.start;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.commons.io.IOUtils;
+import org.osgi.framework.BundleContext;
+import org.springframework.osgi.web.tomcat.internal.Activator;
+
+/** Starts Catalina (hacked from Spring OSGi 1.0) */
+public class CatalinaActivator extends Activator {
+ private final static String ARGEO_OSGI_DATA_DIR = "argeo.osgi.data.dir";
+ /** System properties used to override Tomcat XML config URL */
+ public final static String ARGEO_SERVER_TOMCAT_CONFIG = "argeo.server.tomcat.config";
+
+ public void start(BundleContext context) throws Exception {
+ if (!System.getProperties().containsKey(ARGEO_OSGI_DATA_DIR)) {
+ String osgiInstanceArea = System.getProperty("osgi.instance.area");
+ String osgiInstanceAreaDefault = System
+ .getProperty("osgi.instance.area.default");
+ String tempDir = System.getProperty("java.io.tmpdir");
+
+ File dataDir = null;
+ if (osgiInstanceArea != null) {
+ // within OSGi with -data specified
+ osgiInstanceArea = removeFilePrefix(osgiInstanceArea);
+ dataDir = new File(osgiInstanceArea);
+ } else if (osgiInstanceAreaDefault != null) {
+ // within OSGi without -data specified
+ osgiInstanceAreaDefault = removeFilePrefix(osgiInstanceAreaDefault);
+ dataDir = new File(osgiInstanceAreaDefault);
+ } else {// outside OSGi
+ dataDir = new File(tempDir + File.separator + "osgiData");
+ }
+
+ System.setProperty(ARGEO_OSGI_DATA_DIR, dataDir.getAbsolutePath());
+ }
+
+ // Load config properties and put them in system properties so that they
+ // can be used in tomcat conf
+ Properties confProps = new Properties();
+ URL propsUrl = context.getBundle().getResource("tomcat.properties");
+ if (propsUrl != null) {
+ InputStream in = null;
+ try {
+ in = propsUrl.openStream();
+ confProps.load(in);
+ } catch (Exception e) {
+ throw new RuntimeException("Cannot read catalina properties.",
+ e);
+ } finally {
+ IOUtils.closeQuietly(in);
+ }
+
+ for (Object key : confProps.keySet()) {
+ // System properties have priority
+ if (!System.getProperties().containsKey(key)) {
+ System.setProperty(key.toString(),
+ confProps.getProperty(key.toString()));
+ }
+ }
+ }
+
+ // calling Catalina.setCatalinaHome(String) or
+ // Catalina.setCatalinaBase(String) does the same
+ if (System.getProperty("catalina.home") == null)
+ System.setProperty("catalina.home",
+ System.getProperty(ARGEO_OSGI_DATA_DIR) + "/tomcat");
+ if (System.getProperty("catalina.base") == null)
+ System.setProperty("catalina.base",
+ System.getProperty(ARGEO_OSGI_DATA_DIR) + "/tomcat");
+
+ // Call Spring starter
+ super.start(context);
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ }
+
+ protected String removeFilePrefix(String url) {
+ if (url.startsWith("file:"))
+ return url.substring("file:".length());
+ else if (url.startsWith("reference:file:"))
+ return url.substring("reference:file:".length());
+ else
+ return url;
+ }
+
+}
+++ /dev/null
-package org.argeo.dep.osgi.catalina.start;
-
-import java.io.File;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Properties;
-
-import org.apache.commons.io.IOUtils;
-import org.osgi.framework.BundleContext;
-import org.springframework.osgi.web.tomcat.internal.Activator;
-
-/** Starts Catalina (hacked from Spring OSGi 1.0) */
-public class CatalinaActivator extends Activator {
- private final static String ARGEO_OSGI_DATA_DIR = "argeo.osgi.data.dir";
-
- public void start(BundleContext context) throws Exception {
- if (!System.getProperties().containsKey(ARGEO_OSGI_DATA_DIR)) {
- String osgiInstanceArea = System.getProperty("osgi.instance.area");
- String osgiInstanceAreaDefault = System
- .getProperty("osgi.instance.area.default");
- String tempDir = System.getProperty("java.io.tmpdir");
-
- File dataDir = null;
- if (osgiInstanceArea != null) {
- // within OSGi with -data specified
- osgiInstanceArea = removeFilePrefix(osgiInstanceArea);
- dataDir = new File(osgiInstanceArea);
- } else if (osgiInstanceAreaDefault != null) {
- // within OSGi without -data specified
- osgiInstanceAreaDefault = removeFilePrefix(osgiInstanceAreaDefault);
- dataDir = new File(osgiInstanceAreaDefault);
- } else {// outside OSGi
- dataDir = new File(tempDir + File.separator + "osgiData");
- }
-
- System.setProperty(ARGEO_OSGI_DATA_DIR, dataDir.getAbsolutePath());
- }
-
- // Load config properties and put them in system properties so that they
- // can be used in tomcat conf
- Properties confProps = new Properties();
- URL propsUrl = context.getBundle().getResource("tomcat.properties");
- if (propsUrl != null) {
- InputStream in = null;
- try {
- in = propsUrl.openStream();
- confProps.load(in);
- } catch (Exception e) {
- throw new RuntimeException("Cannot read catalina properties.",
- e);
- } finally {
- IOUtils.closeQuietly(in);
- }
-
- for (Object key : confProps.keySet()) {
- // System properties have priority
- if (!System.getProperties().containsKey(key)) {
- System.setProperty(key.toString(),
- confProps.getProperty(key.toString()));
- }
- }
- }
-
- // calling Catalina.setCatalinaHome(String) or
- // Catalina.setCatalinaBase(String) does the same
- if (System.getProperty("catalina.home") == null)
- System.setProperty("catalina.home",
- System.getProperty(ARGEO_OSGI_DATA_DIR) + "/tomcat");
- if (System.getProperty("catalina.base") == null)
- System.setProperty("catalina.base",
- System.getProperty(ARGEO_OSGI_DATA_DIR) + "/tomcat");
-
- // Call Spring starter
- super.start(context);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
- protected String removeFilePrefix(String url) {
- if (url.startsWith("file:"))
- return url.substring("file:".length());
- else if (url.startsWith("reference:file:"))
- return url.substring("reference:file:".length());
- else
- return url;
- }
-
-}
import org.apache.commons.logging.Log;\r
import org.apache.commons.logging.LogFactory;\r
import org.apache.naming.resources.DirContextURLStreamHandler;\r
+import org.argeo.catalina.start.CatalinaActivator;\r
import org.osgi.framework.Bundle;\r
import org.osgi.framework.BundleActivator;\r
import org.osgi.framework.BundleContext;\r
* Simple activator for starting Apache Tomcat Catalina container inside OSGi\r
* using Tomcat's XML configuration files.\r
* \r
- * <p/> This activator looks initially for a <code>conf/server.xml</code> file\r
- * falling back to <code>conf/default-server.xml</code>. This allows the\r
- * default configuration to be tweaked through fragments for example.\r
+ * <p/>\r
+ * This activator looks initially for a <code>conf/server.xml</code> file\r
+ * falling back to <code>conf/default-server.xml</code>. This allows the default\r
+ * configuration to be tweaked through fragments for example.\r
* \r
* @author Costin Leau\r
*/\r
\r
private Thread startupThread;\r
\r
-\r
public void start(BundleContext context) throws Exception {\r
this.bundleContext = context;\r
// do the initialization on a different thread\r
Connector[] connectors = server.findConnectors();\r
for (int i = 0; i < connectors.length; i++) {\r
Connector conn = connectors[i];\r
- log.info("Succesfully started " + ServerInfo.getServerInfo() + " @ " + conn.getDomain() + ":"\r
- + conn.getPort());\r
+ log.info("Succesfully started "\r
+ + ServerInfo.getServerInfo() + " @ "\r
+ + conn.getDomain() + ":" + conn.getPort());\r
}\r
\r
// register URL service\r
urlRegistration = registerTomcatJNDIUrlService();\r
// publish server as an OSGi service\r
registration = publishServerAsAService(server);\r
- log.info("Published " + ServerInfo.getServerInfo() + " as an OSGi service");\r
- }\r
- catch (Exception ex) {\r
+ log.info("Published " + ServerInfo.getServerInfo()\r
+ + " as an OSGi service");\r
+ } catch (Exception ex) {\r
String msg = "Cannot start " + ServerInfo.getServerInfo();\r
log.error(msg, ex);\r
throw new RuntimeException(msg, ex);\r
- }\r
- finally {\r
+ } finally {\r
current.setContextClassLoader(old);\r
}\r
}\r
\r
try {\r
current.setContextClassLoader(cl);\r
- //reset CCL \r
+ // reset CCL\r
// current.setContextClassLoader(null);\r
log.info("Stopping " + ServerInfo.getServerInfo() + " ...");\r
server.stop();\r
log.info("Succesfully stopped " + ServerInfo.getServerInfo());\r
- }\r
- catch (Exception ex) {\r
+ } catch (Exception ex) {\r
log.error("Cannot stop " + ServerInfo.getServerInfo(), ex);\r
throw ex;\r
- }\r
- finally {\r
+ } finally {\r
current.setContextClassLoader(old);\r
}\r
}\r
\r
- private StandardService createCatalinaServer(Bundle bundle) throws Exception {\r
- // first try to use the XML file\r
- URL xmlConfiguration = bundle.getResource(XML_CONF_LOCATION);\r
+ private StandardService createCatalinaServer(Bundle bundle)\r
+ throws Exception {\r
+ URL xmlConfiguration = null;\r
+\r
+ if (System.getProperty(CatalinaActivator.ARGEO_SERVER_TOMCAT_CONFIG) != null)\r
+ xmlConfiguration = new URL(\r
+ System.getProperty(CatalinaActivator.ARGEO_SERVER_TOMCAT_CONFIG));\r
+ else\r
+ // fragment\r
+ xmlConfiguration = bundle.getResource(XML_CONF_LOCATION);\r
\r
if (xmlConfiguration != null) {\r
log.info("Using custom XML configuration " + xmlConfiguration);\r
- }\r
- else {\r
+ } else {\r
xmlConfiguration = bundle.getResource(DEFAULT_XML_CONF_LOCATION);\r
if (xmlConfiguration == null)\r
log.error("No XML configuration found; bailing out...");\r
return createServerFromXML(xmlConfiguration);\r
}\r
\r
- private StandardService createServerFromXML(URL xmlConfiguration) throws IOException {\r
+ private StandardService createServerFromXML(URL xmlConfiguration)\r
+ throws IOException {\r
OsgiCatalina catalina = new OsgiCatalina();\r
catalina.setAwait(false);\r
catalina.setUseShutdownHook(false);\r
catalina.setName("Catalina");\r
- catalina.setParentClassLoader(Thread.currentThread().getContextClassLoader());\r
+ catalina.setParentClassLoader(Thread.currentThread()\r
+ .getContextClassLoader());\r
\r
- // copy the URL file to a local temporary file (since Catalina doesn't use URL unfortunately)\r
+ // copy the URL file to a local temporary file (since Catalina doesn't\r
+ // use URL unfortunately)\r
File configTempFile = File.createTempFile("dm.catalina", ".cfg.xml");\r
configTempFile.deleteOnExit();\r
\r
// copy URL to temporary file\r
- copyURLToFile(xmlConfiguration.openStream(), new FileOutputStream(configTempFile));\r
- log.debug("Copied configuration " + xmlConfiguration + " to temporary file " + configTempFile);\r
+ copyURLToFile(xmlConfiguration.openStream(), new FileOutputStream(\r
+ configTempFile));\r
+ log.debug("Copied configuration " + xmlConfiguration\r
+ + " to temporary file " + configTempFile);\r
\r
catalina.setConfigFile(configTempFile.getAbsolutePath());\r
\r
while ((bytesRead = inStream.read(buf)) >= 0) {\r
outStream.write(buf, 0, bytesRead);\r
}\r
- }\r
- catch (IOException ex) {\r
- throw (RuntimeException) new IllegalStateException("Cannot copy URL to file").initCause(ex);\r
- }\r
- finally {\r
+ } catch (IOException ex) {\r
+ throw (RuntimeException) new IllegalStateException(\r
+ "Cannot copy URL to file").initCause(ex);\r
+ } finally {\r
try {\r
inStream.close();\r
- }\r
- catch (IOException ignore) {\r
+ } catch (IOException ignore) {\r
}\r
try {\r
outStream.close();\r
- }\r
- catch (IOException ignore) {\r
+ } catch (IOException ignore) {\r
}\r
}\r
}\r
props.put(Constants.SERVICE_VENDOR, "Spring Dynamic Modules");\r
props.put(Constants.SERVICE_DESCRIPTION, ServerInfo.getServerInfo());\r
props.put(Constants.BUNDLE_VERSION, ServerInfo.getServerNumber());\r
- props.put(Constants.BUNDLE_NAME, bundleContext.getBundle().getSymbolicName());\r
+ props.put(Constants.BUNDLE_NAME, bundleContext.getBundle()\r
+ .getSymbolicName());\r
\r
// spring-dm specific property\r
props.put("org.springframework.osgi.bean.name", "tomcat-server");\r
\r
- // publish just the interfaces and the major classes (server/handlerWrapper)\r
- String[] classes = new String[] { StandardService.class.getName(), Service.class.getName(),\r
- MBeanRegistration.class.getName(), Lifecycle.class.getName() };\r
+ // publish just the interfaces and the major classes\r
+ // (server/handlerWrapper)\r
+ String[] classes = new String[] { StandardService.class.getName(),\r
+ Service.class.getName(), MBeanRegistration.class.getName(),\r
+ Lifecycle.class.getName() };\r
\r
return bundleContext.registerService(classes, server, props);\r
}\r
properties.put(URLConstants.URL_HANDLER_PROTOCOL, "jndi");\r
final URLStreamHandler handler = new DirContextURLStreamHandler();\r
\r
- return bundleContext.registerService(URLStreamHandlerService.class.getName(),\r
- new AbstractURLStreamHandlerService() {\r
+ return bundleContext.registerService(\r
+ URLStreamHandlerService.class.getName(),\r
+ new AbstractURLStreamHandlerService() {\r
\r
- private final static String EMPTY_STRING = "";\r
+ private final static String EMPTY_STRING = "";\r
\r
-\r
- public URLConnection openConnection(URL u) throws IOException {\r
- return new URL(u, EMPTY_STRING, handler).openConnection();\r
- }\r
- }, properties);\r
+ public URLConnection openConnection(URL u)\r
+ throws IOException {\r
+ return new URL(u, EMPTY_STRING, handler)\r
+ .openConnection();\r
+ }\r
+ }, properties);\r
}\r
}
\ No newline at end of file
-<Server port="8005" shutdown="SHUTDOWN">\r
-\r
-\r
- <Service name="Catalina">\r
- <Connector port="8080" />\r
-\r
- <Engine name="Catalina" defaultHost="localhost">\r
- <Host name="localhost" unpackWARs="false" autoDeploy="false"\r
- liveDeploy="false" deployOnStartup="false" xmlValidation="false"\r
- xmlNamespaceAware="false">\r
- </Host>\r
- </Engine>\r
-\r
-\r
- </Service>\r
-</Server>\r
+<?xml version='1.0' encoding='utf-8'?>
+<Server port="-1" shutdown="SHUTDOWN">
+ <!--APR library loader. Documentation at /docs/apr.html -->
+ <!-- <Listener className="org.apache.catalina.core.AprLifecycleListener"
+ SSLEngine="on" /> -->
+ <!-- Initialize Jasper prior to webapps are loaded. -->
+ <Listener className="org.apache.catalina.core.JasperListener" />
+ <!-- JMX -->
+ <!-- <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
+ /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
+ /> -->
+
+ <Service name="Catalina">
+ <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
+ maxThreads="150" minSpareThreads="4" />
+
+ <!-- HTTP -->
+ <Connector executor="tomcatThreadPool" port="${argeo.server.port.http}"
+ protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="${argeo.server.port.https}"
+ secure="${argeo.server.http.secure}" proxyName="${argeo.server.http.proxyName}"
+ proxyPort="${argeo.server.http.proxyPort}" />
+ <!-- HTTPS
+ <Connector port="${argeo.server.port.https}" protocol="HTTP/1.1"
+ SSLEnabled="true" scheme="https" secure="true" sslProtocol="TLS"
+ keystoreFile="${argeo.server.keystoreFile}" keystoreType="JKS"
+ keystorePass="${argeo.server.keystorePass}" truststoreFile="${argeo.server.truststoreFile}"
+ truststoreType="JKS" truststorePass="${argeo.server.truststorePass}"
+ clientAuth="${argeo.server.https.clientAuth}" />
+ -->
+ <!-- AJP (for proxying with httpd) -->
+ <Connector port="${argeo.server.port.ajp}" protocol="AJP/1.3"
+ redirectPort="${argeo.server.port.https}" />
+
+ <Engine name="Catalina" defaultHost="localhost">
+ <Host name="localhost" appBase="webapps" unpackWARs="true"
+ autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"
+ workDir="work">
+ </Host>
+ </Engine>
+ </Service>
+</Server>
\ No newline at end of file
--- /dev/null
+argeo.server.port.http=7070
+argeo.server.port.https=7073
+argeo.server.port.ajp=7079
+
+# Used only when SSL is activated (uncommented in server.xml)
+argeo.server.keystoreFile=../../../../ssl/server.ks
+argeo.server.keystorePass=changeit
+argeo.server.truststoreFile=../../../../ssl/server.ts
+argeo.server.truststorePass=changeit
+argeo.server.https.clientAuth=want
+
+argeo.server.http.proxyName=
+argeo.server.http.proxyPort=
+argeo.server.http.secure=false
\ No newline at end of file
<modules>
<module>org.argeo.server.core</module>
<module>org.argeo.server.json</module>
+ <module>org.argeo.server.catalina.start</module>
<module>org.argeo.server.webextender</module>
<module>org.argeo.server.jxl</module>
<module>org.argeo.server.hibernate</module>