Author: fmeschbe
Date: Fri Jun 13 02:40:34 2008
New Revision: 667440
URL: http://svn.apache.org/viewvc?rev=667440&view=rev
Log:
SLING-531 Include Servlet API into standalone launcher and export
from system bundle.
Modified:
incubator/sling/trunk/launchpad/app/pom.xml
incubator/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launcher/app/main/Main.java
Modified: incubator/sling/trunk/launchpad/app/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/app/pom.xml?rev=667440&r1=667439&r2=667440&view=diff
==============================================================================
--- incubator/sling/trunk/launchpad/app/pom.xml (original)
+++ incubator/sling/trunk/launchpad/app/pom.xml Fri Jun 13 02:40:34 2008
@@ -73,7 +73,7 @@
</goals>
<configuration>
<excludeArtifactIds>
-
org.apache.felix.framework,org.osgi.core,org.osgi.compendium,org.apache.sling.commons.log,org.apache.sling.launchpad.base
+
org.apache.felix.framework,org.osgi.core,org.osgi.compendium,servlet-api,org.apache.sling.commons.log,org.apache.sling.launchpad.base
</excludeArtifactIds>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>
@@ -88,7 +88,7 @@
</goals>
<configuration>
<includeArtifactIds>
- org.osgi.core,org.osgi.compendium
+ org.osgi.core,org.osgi.compendium,servlet-api
</includeArtifactIds>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>
@@ -178,9 +178,15 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
- <scope>provded</scope>
+ <scope>provided</scope>
</dependency>
<!-- the most important bundle after the framework: logging -->
Modified:
incubator/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launcher/app/main/Main.java
URL:
http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launcher/app/main/Main.java?rev=667440&r1=667439&r2=667440&view=diff
==============================================================================
---
incubator/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launcher/app/main/Main.java
(original)
+++
incubator/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launcher/app/main/Main.java
Fri Jun 13 02:40:34 2008
@@ -27,7 +27,7 @@
import org.apache.sling.launcher.app.ResourceProvider;
import org.apache.sling.launcher.app.Sling;
import org.osgi.framework.BundleException;
-
+import org.osgi.framework.Constants;
/**
* The <code>Main</code> class is a simple Java Application which interprests
@@ -87,6 +87,13 @@
/** The default port on which the HTTP service listens. */
private static final String DEFAULT_PORT = "8080";
+ /**
+ * The property value to export the Servlet API 2.5 from the system
+ * bundle.
+ */
+ private static final String SERVLET_API_EXPORT =
+ "javax.servlet;javax.servlet.http;javax.servlet.resources;
version=2.5";
+
/** The parsed command line mapping (Sling) option name to option value */
private static Map<String, String> commandLine;
@@ -113,13 +120,14 @@
if (!commandLine.containsKey(PROP_LOG_LEVEL)) {
logLevel = DEFAULT_LOG_LEVEL;
} else {
- logLevel = toLogLevelInt(commandLine.get(PROP_LOG_LEVEL),
DEFAULT_LOG_LEVEL);
+ logLevel = toLogLevelInt(commandLine.get(PROP_LOG_LEVEL),
+ DEFAULT_LOG_LEVEL);
commandLine.put(LOG_LEVEL_PROP, String.valueOf(logLevel));
}
Logger logger = new Logger();
-
+
// prevent tons of needless WARN from the framework
-// logger.setLogLevel(logLevel);
+ // logger.setLogLevel(logLevel);
logger.setLogLevel(Logger.LOG_ERROR);
// prevent tons of needless WARN messages from the framework
@@ -135,6 +143,16 @@
if (commandLine != null) {
properties.putAll(commandLine);
}
+
+ // add Servlet API to the system bundle exports
+ String sysExport =
properties.get(Constants.FRAMEWORK_SYSTEMPACKAGES);
+ if (sysExport == null) {
+ sysExport = SERVLET_API_EXPORT;
+ } else {
+ sysExport += "," + SERVLET_API_EXPORT;
+ }
+ properties.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
+ sysExport);
}
};