I am running a scala 2.11.12 app on lift 3.3.0 built with sbt 1.3.8. I have tried 4.0.3 and 4.2.0 of xsbt-web-plugin. My app launches fine when I use jetty:start but when I use jetty:quickstart it fails to launch - I get a 500 error in the browser and when I check the application log in the console I see java.lang.NoSuchMethodError: 'int javax.servlet.http.HttpServletResponse.getStatus()' which causes the jetty instance to give back a 500.
** edit ive gone back further in my logile
What is the difference between how quickstart runs and how start runs? I cant figure out the problem.
Below is my build.sbt in case it helps. Below that Ive include the console logs for the request in jetty:quickstart showing the error Im getting. I dont get this error for jetty:start.
** edit 2 Ive jun jetty:start then show update, and jetty:quickstart then show update. They both have javax.servlet:servlet-api:2.5:default as a dependency. But jetty:start works fine and starts the container, while jetty:quickstart fails to initialize the container. I'm at a loss to understand why one works and one fails - it seems to me both should fail.
** edit 3 I figured out why servlet-api 2.5 was coming in, and have updated the paypal dependencies to fix that. I'd still love to know why jetty:start worked but jetty:quickstart didnt - they both seemingly should've failed.
build.sbt
name := "knot-core"
organization := "com.postrope"
version := "0.0.1"
scalaVersion := "2.11.12"
excludeFilter := HiddenFileFilter -- ".ebextensions"
resolvers ++= Seq(
"Sonatype scala-tools releases" at "https://oss.sonatype.org/content/repositories/releases",
"Sonatype scala-tools snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
)
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
libraryDependencies ++= {
val liftVersion = "3.3.0"
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile",
"junit" % "junit" % "4.7" % "test",
"ch.qos.logback" % "logback-core" % "1.0.0",
"ch.qos.logback" % "logback-classic" % "1.0.0",
"mysql" % "mysql-connector-java" % "8.0.19",
"org.ccil.cowan.tagsoup" % "tagsoup" % "1.2",
"net.liftmodules" %% "paypal_3.0" % "1.3.0",
"com.paypal.sdk" % "adaptivepaymentssdk" % "2.6.110",
"com.paypal.sdk" % "adaptiveaccountssdk" % "2.4.106",
"org.apache.solr" % "solr-solrj" % "4.4.0",
"org.imgscalr" % "imgscalr-lib" % "4.2",
"org.jsoup" % "jsoup" % "1.7.3",
"com.amazonaws" % "aws-java-sdk" % "1.7.3",
"org.seleniumhq.selenium" % "selenium-java" % "3.9.1",
"org.seleniumhq.selenium" % "selenium-chrome-driver" % "3.9.1",
"org.scalatest" %% "scalatest" % "3.1.1" % "test",
"net.databinder.dispatch" %% "dispatch-core" % "0.11.2",
"net.databinder" %% "dispatch-core" % "0.8.10",
"net.databinder" %% "dispatch-http" % "0.8.10",
"net.databinder" %% "dispatch-oauth" % "0.8.10",
"net.databinder" %% "dispatch-http-json" % "0.8.10"
)
}
enablePlugins(JettyPlugin)
javaOptions in Jetty ++= Seq(
"-Xdebug",
"-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"
)
//jRebel class reload support
Seq(JRebelPlugin.jrebelSettings: _*)
jrebelWebLinks += (sourceDirectory in Compile).value / "webapp"
jrebelEnabled := true
javaOptions in Jetty ++= Seq(
"-agentpath:C:\\Users\\drewb\\tools\\jrebel-2020.2.0\\lib\\jrebel64.dll",
)
Error in jetty:quickstart
02:03:55.221 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpChannel - REQUEST for //localhost:8080/ on HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=IDLE,uri=//localhost:8080/,age=1}
GET //localhost:8080/ HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: http://localhost:8080/
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: _ga=GA1.1.498072716.1587178043; _gid=GA1.1.223715266.1587738288; JSESSIONID=node01b1y37p1yogb5tgcxs7c0pofr0.node0; _gat=1
02:03:55.221 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpChannel - HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=IDLE,uri=//localhost:8080/,age=2} onContentComplete
02:03:55.222 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpChannel - HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=IDLE,uri=//localhost:8080/,age=3} onRequestComplete
02:03:55.222 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpInput - HttpInputOverHTTP@243824e[c=0,q=0,[0]=null,s=STREAM] addContent EOF
02:03:55.222 [qtp101874302-67] DEBUG o.e.jetty.server.HttpConnection - HttpConnection@70d9094a::SocketChannelEndPoint@7785c24d{/0:0:0:0:0:0:0:1:55305<->/0:0:0:0:0:0:0:1:8080,OPEN,fill=-,flush=-,to=19/30000}{io=0/0,kio=0,kro=1}->HttpConnection@70d9094a[p=HttpParser{s=END,0 of -1},g=HttpGenerator@43f6ae01{s=START}]=>HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=IDLE,uri=//localhost:8080/,age=3} parsed true HttpParser{s=END,0 of -1}
02:03:55.223 [qtp101874302-67] DEBUG o.e.jetty.server.HttpConnection - releaseRequestBuffer HttpConnection@70d9094a::SocketChannelEndPoint@7785c24d{/0:0:0:0:0:0:0:1:55305<->/0:0:0:0:0:0:0:1:8080,OPEN,fill=-,flush=-,to=19/30000}{io=0/0,kio=0,kro=1}->HttpConnection@70d9094a[p=HttpParser{s=END,0 of -1},g=HttpGenerator@43f6ae01{s=START}]=>HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=IDLE,uri=//localhost:8080/,age=4}
02:03:55.224 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpChannel - HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=IDLE,uri=//localhost:8080/,age=5} handle //localhost:8080/
02:03:55.224 [qtp101874302-67] DEBUG o.e.jetty.server.HttpChannelState - handling HttpChannelState@69b6a9e2{s=IDLE a=NOT_ASYNC i=true r=IDLE w=false}
02:03:55.227 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpChannel - HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=DISPATCHED,uri=//localhost:8080/,age=8} action DISPATCH
02:03:55.229 [qtp101874302-67] DEBUG org.eclipse.jetty.server.Server - REQUEST GET / on HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=DISPATCHED,uri=//localhost:8080/,age=10}
02:03:55.229 [qtp101874302-67] DEBUG o.e.j.server.handler.ContextHandler - scope null||/ @ o.e.j.w.WebAppContext@1a45193b{/,file:///C:/Users/drewb/IdeaProjects/knot-alpha/src/main/webapp/,UNAVAILABLE}{file:///C:/Users/drewb/IdeaProjects/knot-alpha/src/main/webapp/}
02:03:55.232 [qtp101874302-67] WARN org.eclipse.jetty.server.HttpChannel - /
java.lang.NoSuchMethodError: 'int javax.servlet.http.HttpServletResponse.getStatus()'
at org.eclipse.jetty.server.handler.ErrorHandler.doError(ErrorHandler.java:138) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ErrorHandler.handle(ErrorHandler.java:74) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.Response.sendError(Response.java:454) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.Response.sendError(Response.java:391) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandler.checkContext(ContextHandler.java:1108) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1149) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.Server.handle(Server.java:494) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
02:03:55.232 [qtp101874302-67] DEBUG o.e.jetty.server.HttpChannelState - onError HttpChannelState@69b6a9e2{s=DISPATCHED a=NOT_ASYNC i=true r=IDLE w=false} {}
02:03:55.232 [qtp101874302-67] DEBUG o.e.jetty.server.HttpChannelState - unhandle HttpChannelState@69b6a9e2{s=THROWN a=NOT_ASYNC i=true r=IDLE w=false}
02:03:55.232 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpChannel - HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=DISPATCHED,uri=//localhost:8080/,age=13} action ERROR_DISPATCH
02:03:55.234 [qtp101874302-67] DEBUG org.eclipse.jetty.server.Server - ERROR GET / on HttpChannelOverHttp@c1f8711{r=1,c=false,c=false/false,a=DISPATCHED,uri=//localhost:8080/,age=15}
02:03:55.234 [qtp101874302-67] DEBUG o.e.j.server.handler.ContextHandler - scope null||/ @ o.e.j.w.WebAppContext@1a45193b{/,file:///C:/Users/drewb/IdeaProjects/knot-alpha/src/main/webapp/,UNAVAILABLE}{file:///C:/Users/drewb/IdeaProjects/knot-alpha/src/main/webapp/}
02:03:55.234 [qtp101874302-67] DEBUG o.e.j.server.handler.ContextHandler - context=||/ @ o.e.j.w.WebAppContext@1a45193b{/,file:///C:/Users/drewb/IdeaProjects/knot-alpha/src/main/webapp/,UNAVAILABLE}{file:///C:/Users/drewb/IdeaProjects/knot-alpha/src/main/webapp/}
02:03:55.236 [qtp101874302-67] DEBUG o.e.j.servlet.ErrorPageErrorHandler - getErrorPage(GET /) => error_page=null (from global default)
02:03:55.236 [qtp101874302-67] DEBUG o.e.j.server.handler.ErrorHandler - No Error Page mapping for request(GET /) (using default)
02:03:55.237 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpChannel - Could not perform ERROR dispatch, aborting
java.lang.NoSuchMethodError: 'int javax.servlet.http.HttpServletResponse.getStatus()'
at org.eclipse.jetty.server.handler.ErrorHandler.doError(ErrorHandler.java:138) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ErrorHandler.handle(ErrorHandler.java:74) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.Response.sendError(Response.java:454) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.AbstractHandler.doError(AbstractHandler.java:93) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandler.__doHandle(ContextHandler.java:1301) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:42003) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:190) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.Server.handle(Server.java:494) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:429) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
02:03:55.238 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpChannel - sendResponse info=null content=HeapByteBuffer@47b52cca[p=0,l=0,c=0,r=0]={<<<>>>} complete=false committing=true callback=Blocker@4483efeb{null}
02:03:55.238 [qtp101874302-67] DEBUG org.eclipse.jetty.server.HttpChannel - COMMIT for / on HttpChannelOverHttp@c1f8711{r=1,c=true,c=false/false,a=DISPATCHED,uri=//localhost:8080/,age=19}
500 null HTTP/1.1
Container initialisation error
11:21:49.793 [main] DEBUG o.eclipse.jetty.webapp.WebAppContext - isServerClass==true class org.eclipse.jetty.annotations.ServletContainerInitializersStarter
11:21:49.793 [main] WARN o.e.j.u.component.AbstractLifeCycle - FAILED ServletContainerInitializersStarter@285f09de{FAILED}: java.lang.NoSuchMethodError: 'javax.servlet.descriptor.JspConfigDescriptor javax.servlet.ServletContext.getJspConfigDescriptor()'
java.lang.NoSuchMethodError: 'javax.servlet.descriptor.JspConfigDescriptor javax.servlet.ServletContext.getJspConfigDescriptor()'
at org.apache.jasper.servlet.TldScanner.scanJspConfig(TldScanner.java:158) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:102) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:101) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:141) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:64) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:342) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1443) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1407) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:821) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:276) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.Server.start(Server.java:407) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.server.Server.doStart(Server.java:371) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.runner.Runner.run(Runner.java:520) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
at org.eclipse.jetty.runner.Runner.main(Runner.java:565) ~[jetty-runner-9.4.20.v20190813.jar:9.4.20.v20190813]
11:21:49.794 [main] WARN o.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext@4bd1f8dd{/,file:///C:/Users/drewb/IdeaProjects/knot-alpha/src/main/webapp/,UNAVAILABLE}{file:///C:/Users/drewb/IdeaProjects/knot-alpha/src/main/webapp/
The jetty:start
and jetty:quickstart
commands both come from xsbt-web-plugin. Note that jetty:quickstart
is unrelated to the Quickstart Webapps feature of Jetty.
The main difference between the two is that start
builds a complete package of your project and quickstart
does not. With quickstart
, no .war file is created, your classes are not packaged up in a .jar file, etc.
With quickstart
, Jetty is run using your project's runtime classpath as managed by sbt. With start
, Jetty is run with only your project's package, and the dependencies it contains as .jar files. These can differ, as sbt's runtime classpath will include dependencies in the provided
scope, while your package will not. This is why one is working for you, and the other is not.
Your error:
java.lang.NoSuchMethodError: 'int javax.servlet.http.HttpServletResponse.getStatus()'
Indicates that you have a version conflict between the servlet-api
.jar on your classpath, and the one that Jetty expects. One or more of your project's dependencies must have a transitive dependency on an old version of servlet-api
.
There are multiple ways to inspect the dependency tree. Using Coursier, I see that your two Paypal libraries both depend on servlet-api
2.5:
├─ com.paypal.sdk:adaptiveaccountssdk:2.4.106
│ └─ com.paypal.sdk:paypal-core:1.4.4
│ ├─ com.google.code.gson:gson:2.2.2 -> 2.8.2 (possible incompatibility)
│ ├─ commons-codec:commons-codec:1.6 -> 1.11 (possible incompatibility)
│ └─ javax.servlet:servlet-api:2.5
├─ com.paypal.sdk:adaptivepaymentssdk:2.6.110
│ └─ com.paypal.sdk:paypal-core:1.4.4
│ ├─ com.google.code.gson:gson:2.2.2 -> 2.8.2 (possible incompatibility)
│ ├─ commons-codec:commons-codec:1.6 -> 1.11 (possible incompatibility)
│ └─ javax.servlet:servlet-api:2.5
This needs to be excluded, as it is too old for the version of Jetty you're using.
There are multiple ways to exclude transitive dependencies in sbt. By adding exclude("javax.servlet", "servlet-api")
to both of your Paypal dependencies, we can block the conflicting version of servlet-api
:
"com.paypal.sdk" % "adaptivepaymentssdk" % "2.6.110" exclude("javax.servlet", "servlet-api"),
"com.paypal.sdk" % "adaptiveaccountssdk" % "2.4.106" exclude("javax.servlet", "servlet-api"),
You'll also want to add a recent one to provided
scope so your code can compile:
libraryDependencies += "javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided"