Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Trying to configure SSL with Lift and jetty's start.jar

399 views
Skip to first unread message

Lance Walton

unread,
Oct 17, 2011, 8:53:39 AM10/17/11
to The Lift Book
Hi all.

I have a lift app and I'm trying to configure jetty to use ssl.

I'm using scala 2.9.1, lift version 2.4-M4, jetty version
7.5.1.v20110908 and sbt 0.11.

I get sbt to produce a war file and I run it using: java -Xms512m -
Xmx1024m -Xss4m -jar start.jar --port 8080 lift-test_2.9.1-1.0.0.war

This starts up fine and I can connect using HTTP.

I then copy the jetty-ssl.xml file from the jetty 7.5.1.v20110908
distribution, which looks like this:

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://
www.eclipse.org/jetty/configure.dtd">

<!-- =============================================================== --
>
<!-- Configure SSL for the Jetty Server --
>
<!-- this configuration file should be used in combination with --
>
<!-- other configuration files. e.g. --
>
<!-- java -jar start.jar etc/jetty-ssl.xml --
>
<!-- --
>
<!-- alternately, add to the start.ini for easier usage --
>
<!-- =============================================================== --
>
<Configure id="Server" class="org.eclipse.jetty.server.Server">

<!-- if NIO is not available, use
org.eclipse.jetty.server.ssl.SslSocketConnector -->

<New id="sslContextFactory"
class="org.eclipse.jetty.http.ssl.SslContextFactory">
<Set name="KeyStore"><Property name="jetty.home" default="." />/
etc/keystore</Set>
<Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</
Set>
<Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
<Set name="TrustStore"><Property name="jetty.home" default="." />/
etc/keystore</Set>
<Set name="TrustStorePassword">OBF:
1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
</New>

<Call name="addConnector">
<Arg>
<New
class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<Arg><Ref id="sslContextFactory" /></Arg>
<Set name="Port">8443</Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">2</Set>
<Set name="AcceptQueueSize">100</Set>
</New>
</Arg>
</Call>
</Configure>

I then try to run it using: java -Xms512m -Xmx1024m -Xss4m -jar
start.jar etc/jetty-ssl.xml

And I get:

2011-10-17 13:41:29.426:INFO:omjr.Runner:Runner
2011-10-17 13:41:29.427:WARN:omjr.Runner:No tx manager found
java.lang.ClassCastException: org.eclipse.jetty.server.Server cannot
be cast to org.eclipse.jetty.server.handler.ContextHandler
at org.mortbay.jetty.runner.Runner.configure(Runner.java:364)
at org.mortbay.jetty.runner.Runner.main(Runner.java:638)

If I use that command line from within a clean jetty distribution
directory, I don't get this exception and I can look at the web page
using http://localhost:8443

Can anybody shed any light on this?

Regards,

Lance

Lance Walton

unread,
Oct 17, 2011, 9:31:40 AM10/17/11
to The Lift Book
Should this have gone to the http://groups.google.com/group/liftweb?lnk=srg
group instead?

Regards,

Lance
Reply all
Reply to author
Forward
0 new messages