Skip to content
Snippets Groups Projects
Commit f3eed5fd authored by buczekp's avatar buczekp
Browse files

[LMS-1551] migrated DSS to Jetty7

SVN: 16579
parent 2e817400
No related branches found
No related tags found
No related merge requests found
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
<classpathentry kind="lib" path="/libraries/jmock/objenesis/objenesis-1.0.jar"/> <classpathentry kind="lib" path="/libraries/jmock/objenesis/objenesis-1.0.jar"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/openbis"/> <classpathentry combineaccessrules="false" exported="true" kind="src" path="/openbis"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/server-common"/> <classpathentry combineaccessrules="false" exported="true" kind="src" path="/server-common"/>
<classpathentry kind="lib" path="/libraries/jetty/jetty.jar" sourcepath="/libraries/jetty/src/jetty.zip"/>
<classpathentry kind="lib" path="/libraries/jetty/jetty-util.jar" sourcepath="/libraries/jetty/src/jetty-util.zip"/>
<classpathentry kind="lib" path="/libraries/jetty/servlet-api-2.5.jar" sourcepath="/libraries/jetty/src/servlet-api-2.5.zip"/>
<classpathentry kind="lib" path="/libraries/spring/spring.jar" sourcepath="/libraries/spring/src.jar"/> <classpathentry kind="lib" path="/libraries/spring/spring.jar" sourcepath="/libraries/spring/src.jar"/>
<classpathentry kind="lib" path="/libraries/cifex/cifex.jar" sourcepath="/cifex/source/java"/> <classpathentry kind="lib" path="/libraries/cifex/cifex.jar" sourcepath="/cifex/source/java"/>
<classpathentry kind="lib" path="/libraries/cisd-base/cisd-base-test.jar" sourcepath="/libraries/cisd-base/cisd-base-src.zip"/> <classpathentry kind="lib" path="/libraries/cisd-base/cisd-base-test.jar" sourcepath="/libraries/cisd-base/cisd-base-src.zip"/>
...@@ -41,5 +38,12 @@ ...@@ -41,5 +38,12 @@
<attribute name="javadoc_location" value="jar:platform:/resource/libraries/jfreechart/jfreechart-1.0.13-javadocs.zip!/jfreechart-1.0.13-javadocs"/> <attribute name="javadoc_location" value="jar:platform:/resource/libraries/jfreechart/jfreechart-1.0.13-javadocs.zip!/jfreechart-1.0.13-javadocs"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="/libraries/jetty7/lib/common/jetty-io.jar"/>
<classpathentry kind="lib" path="/libraries/jetty7/lib/common/jetty-http.jar"/>
<classpathentry kind="lib" path="/libraries/jetty7/lib/common/jetty-util.jar"/>
<classpathentry kind="lib" path="/libraries/jetty7/lib/server/jetty-server.jar"/>
<classpathentry kind="lib" path="/libraries/jetty7/lib/server/jetty-servlet.jar"/>
<classpathentry kind="lib" path="/libraries/jetty7/lib/server/jetty-security.jar"/>
<classpathentry kind="lib" path="/libraries/jetty7/lib/server/servlet-api-2.5.jar"/>
<classpathentry kind="output" path="targets/classes"/> <classpathentry kind="output" path="targets/classes"/>
</classpath> </classpath>
...@@ -53,12 +53,13 @@ ...@@ -53,12 +53,13 @@
<manifest> <manifest>
<attribute name="Main-Class" value="ch.systemsx.cisd.openbis.dss.generic.DataStoreServer" /> <attribute name="Main-Class" value="ch.systemsx.cisd.openbis.dss.generic.DataStoreServer" />
<attribute name="Class-Path" <attribute name="Class-Path"
value="datastore_server-plugins.jar cisd-args4j.jar cisd-base.jar cifex.jar jetty.jar jetty-util.jar value="datastore_server-plugins.jar cisd-args4j.jar cisd-base.jar cifex.jar
servlet-api-2.5.jar log4j.jar activation.jar mail.jar spring.jar fast-md5.jar jetty-http.jar jetty-io.jar jetty-security.jar jetty-server.jar jetty-servlet.jar jetty-util.jar
servlet-api-2.5.jar log4j.jar activation.jar mail.jar spring.jar fast-md5.jar
commons-codec.jar commons-lang.jar commons-io.jar commons-logging.jar commons-codec.jar commons-lang.jar commons-io.jar commons-logging.jar
commons-httpclient.jar commons-pool.jar commons-dbcp.jar eodsql.jar postgresql.jar commons-httpclient.jar commons-pool.jar commons-dbcp.jar eodsql.jar postgresql.jar
ij.jar jaxb-api.jar jaxb-impl.jar jsr173_1-0_api.jar csv.jar ij.jar jaxb-api.jar jaxb-impl.jar jsr173_1-0_api.jar csv.jar
jcommon-1.0.16.jar jfreechart-1.0.13.jar" /> jcommon-1.0.16.jar jfreechart-1.0.13.jar" />
<attribute name="Version" value="${version.number}" /> <attribute name="Version" value="${version.number}" />
<attribute name="Build-Number" <attribute name="Build-Number"
value="${version.number} (r${revision.number},${clean.flag})" /> value="${version.number} (r${revision.number},${clean.flag})" />
...@@ -89,12 +90,16 @@ ...@@ -89,12 +90,16 @@
--> -->
<target name="prepare-dist-libs" depends="dss-jar, dist-client"> <target name="prepare-dist-libs" depends="dss-jar, dist-client">
<copy file="${dss-jar.file}" todir="${dist.datastore_server.lib}" /> <copy file="${dss-jar.file}" todir="${dist.datastore_server.lib}" />
<copy file="${lib}/cisd-base/cisd-base.jar" todir="${dist.datastore_server.lib}" /> <copy todir="${dist.datastore_server.lib}" flatten="true">
<fileset dir="${lib}/jetty7/lib">
<include name="common/*.jar" />
<include name="server/*.jar" />
<exclude name="server/jetty-continuation.jar" />
</fileset>
</copy>
<copy file="${lib}/cisd-base/cisd-base.jar" todir="${dist.datastore_server.lib}" />
<copy file="${lib}/cisd-args4j/cisd-args4j.jar" todir="${dist.datastore_server.lib}" /> <copy file="${lib}/cisd-args4j/cisd-args4j.jar" todir="${dist.datastore_server.lib}" />
<copy file="${lib}/cifex/cifex.jar" todir="${dist.datastore_server.lib}" /> <copy file="${lib}/cifex/cifex.jar" todir="${dist.datastore_server.lib}" />
<copy file="${lib}/jetty/jetty.jar" todir="${dist.datastore_server.lib}" />
<copy file="${lib}/jetty/jetty-util.jar" todir="${dist.datastore_server.lib}" />
<copy file="${lib}/jetty/servlet-api-2.5.jar" todir="${dist.datastore_server.lib}" />
<copy file="${lib}/activation/activation.jar" todir="${dist.datastore_server.lib}" /> <copy file="${lib}/activation/activation.jar" todir="${dist.datastore_server.lib}" />
<copy file="${lib}/mail/mail.jar" todir="${dist.datastore_server.lib}" /> <copy file="${lib}/mail/mail.jar" todir="${dist.datastore_server.lib}" />
<copy file="${lib}/log4j/log4j.jar" todir="${dist.datastore_server.lib}" /> <copy file="${lib}/log4j/log4j.jar" todir="${dist.datastore_server.lib}" />
......
...@@ -24,17 +24,18 @@ import java.util.Enumeration; ...@@ -24,17 +24,18 @@ import java.util.Enumeration;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import javax.servlet.Servlet;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.mortbay.jetty.Server; import org.eclipse.jetty.server.Server;
import org.mortbay.jetty.bio.SocketConnector; import org.eclipse.jetty.server.bio.SocketConnector;
import org.mortbay.jetty.security.SslSocketConnector; import org.eclipse.jetty.server.ssl.SslSocketConnector;
import org.mortbay.jetty.servlet.Context; import org.eclipse.jetty.servlet.ServletContextHandler;
import org.mortbay.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter; import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -184,7 +185,8 @@ public class DataStoreServer ...@@ -184,7 +185,8 @@ public class DataStoreServer
private static void initializeContext(final ApplicationContext applicationContext, private static void initializeContext(final ApplicationContext applicationContext,
final ConfigParameters configParameters, final Server thisServer) final ConfigParameters configParameters, final Server thisServer)
{ {
final Context context = new Context(thisServer, "/", Context.SESSIONS); final ServletContextHandler context =
new ServletContextHandler(thisServer, "/", ServletContextHandler.SESSIONS);
context.setAttribute(APPLICATION_CONTEXT_KEY, applicationContext); context.setAttribute(APPLICATION_CONTEXT_KEY, applicationContext);
context.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, context.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
ServiceProvider.APPLICATION_CONTEXT); ServiceProvider.APPLICATION_CONTEXT);
...@@ -204,7 +206,7 @@ public class DataStoreServer ...@@ -204,7 +206,7 @@ public class DataStoreServer
// TODO 2010-06-01, CR : The registration process here needs to be made cleaner. // TODO 2010-06-01, CR : The registration process here needs to be made cleaner.
// Perhaps by using Spring and the dssApplicationContext.xml more effectively, or perhaps by // Perhaps by using Spring and the dssApplicationContext.xml more effectively, or perhaps by
// using annotations and reflection. // using annotations and reflection.
private static void initializeRpcServices(final Context context, private static void initializeRpcServices(final ServletContextHandler context,
final ApplicationContext applicationContext, final ConfigParameters configParameters) final ApplicationContext applicationContext, final ConfigParameters configParameters)
{ {
// Get the spring bean and do some additional configuration // Get the spring bean and do some additional configuration
...@@ -243,19 +245,28 @@ public class DataStoreServer ...@@ -243,19 +245,28 @@ public class DataStoreServer
rpcNameServer.addSupportedInterfaceVersion(nameServerVersion); rpcNameServer.addSupportedInterfaceVersion(nameServerVersion);
} }
private static void registerPluginServlets(Context context, List<PluginServlet> pluginServlets) @SuppressWarnings("unchecked")
private static void registerPluginServlets(ServletContextHandler context,
List<PluginServlet> pluginServlets)
{ {
for (PluginServlet pluginServlet : pluginServlets) for (PluginServlet pluginServlet : pluginServlets)
{ {
Class<?> classInstance; Class<? extends Servlet> classInstance;
try try
{ {
classInstance = Class.forName(pluginServlet.getServletClass()); classInstance =
(Class<? extends Servlet>) Class.forName(pluginServlet.getServletClass());
} catch (ClassNotFoundException ex) } catch (ClassNotFoundException ex)
{ {
throw EnvironmentFailureException.fromTemplate( throw EnvironmentFailureException.fromTemplate(
"Error while loading servlet plugin class '%s': %s", pluginServlet "Error while loading servlet plugin class '%s': %s", pluginServlet
.getClass(), ex.getMessage()); .getClass(), ex.getMessage());
} catch (ClassCastException ex)
{
throw EnvironmentFailureException.fromTemplate(
"Error while loading servlet plugin class '%s': %s. "
+ "Servlet implementation expected.", pluginServlet.getClass(), ex
.getMessage());
} }
ServletHolder holder = ServletHolder holder =
context.addServlet(classInstance, pluginServlet.getServletPath()); context.addServlet(classInstance, pluginServlet.getServletPath());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment