I have the following code:
val warehouseLocation = new File("spark-warehouse").getAbsolutePath
implicit val spark = SparkSession
.builder
.appName("test")
.config("spark.sql.warehouse.dir", warehouseLocation)
.config("hive.execution.engine","spark")
.enableHiveSupport()
.getOrCreate
spark.sql("CREATE EXTERNAL TABLE IF NOT EXISTS person(name string) STORED AS PARQUET LOCATION '/user/my_user/data/my_data.parquet")
I obtain the following error
client token: Token { kind: YARN_CLIENT_TOKEN, service: }
diagnostics: User class threw exception: java.lang.NoSuchMethodError: com.facebook.fb303.FacebookService$Client.sendBaseOneway(Ljava/lang/String;Lorg/apache/thrift/TBase;)V
at com.facebook.fb303.FacebookService$Client.send_shutdown(FacebookService.java:436)
at com.facebook.fb303.FacebookService$Client.shutdown(FacebookService.java:430)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.close(HiveMetaStoreClient.java:492)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:156)
at com.sun.proxy.$Proxy33.close(Unknown Source)
at org.apache.hadoop.hive.ql.metadata.Hive.close(Hive.java:291)
at org.apache.hadoop.hive.ql.metadata.Hive.access$000(Hive.java:137)
at org.apache.hadoop.hive.ql.metadata.Hive$1.remove(Hive.java:157)
at org.apache.hadoop.hive.ql.metadata.Hive.closeCurrent(Hive.java:261)
at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:231)
at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:208)
at org.apache.hadoop.hive.ql.session.SessionState.setAuthorizerV2Config(SessionState.java:768)
at org.apache.hadoop.hive.ql.session.SessionState.setupAuth(SessionState.java:739)
at org.apache.hadoop.hive.ql.session.SessionState.getAuthenticator(SessionState.java:1394)
at org.apache.hadoop.hive.ql.session.SessionState.getUserFromAuthenticator(SessionState.java:987)
at org.apache.hadoop.hive.ql.metadata.Table.getEmptyTable(Table.java:177)
at org.apache.hadoop.hive.ql.metadata.Table.<init>(Table.java:119)
at org.apache.spark.sql.hive.client.HiveClientImpl$.toHiveTable(HiveClientImpl.scala:898)
at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$createTable$1.apply$mcV$sp(HiveClientImpl.scala:470)
at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$createTable$1.apply(HiveClientImpl.scala:468)
at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$createTable$1.apply(HiveClientImpl.scala:468)
at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$withHiveState$1.apply(HiveClientImpl.scala:274)
at org.apache.spark.sql.hive.client.HiveClientImpl.liftedTree1$1(HiveClientImpl.scala:212)
at org.apache.spark.sql.hive.client.HiveClientImpl.retryLocked(HiveClientImpl.scala:211)
at org.apache.spark.sql.hive.client.HiveClientImpl.withHiveState(HiveClientImpl.scala:257)
at org.apache.spark.sql.hive.client.HiveClientImpl.createTable(HiveClientImpl.scala:468)
at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$doCreateTable$1.apply$mcV$sp(HiveExternalCatalog.scala:258)
at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$doCreateTable$1.apply(HiveExternalCatalog.scala:216)
at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$doCreateTable$1.apply(HiveExternalCatalog.scala:216)
at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatalog.scala:97)
at org.apache.spark.sql.hive.HiveExternalCatalog.doCreateTable(HiveExternalCatalog.scala:216)
at org.apache.spark.sql.catalyst.catalog.ExternalCatalog.createTable(ExternalCatalog.scala:119)
at org.apache.spark.sql.catalyst.catalog.SessionCatalog.createTable(SessionCatalog.scala:307)
at org.apache.spark.sql.execution.command.CreateTableCommand.run(tables.scala:128)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:70)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:68)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:79)
at org.apache.spark.sql.Dataset$$anonfun$6.apply(Dataset.scala:190)
at org.apache.spark.sql.Dataset$$anonfun$6.apply(Dataset.scala:190)
at org.apache.spark.sql.Dataset$$anonfun$52.apply(Dataset.scala:3253)
at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:77)
at org.apache.spark.sql.Dataset.withAction(Dataset.scala:3252)
at org.apache.spark.sql.Dataset.<init>(Dataset.scala:190)
at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:75)
at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:638)
at fr.enedis.ctd.TestHive2$.delayedEndpoint$fr$enedis$ctd$TestHive2$1(TestHive2.scala:23)
at fr.enedis.ctd.TestHive2$delayedInit$body.apply(TestHive2.scala:6)
at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
at scala.App$class.main(App.scala:76)
at fr.enedis.ctd.TestHive2$.main(TestHive2.scala:6)
at fr.enedis.ctd.TestHive2.main(TestHive2.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$4.run(ApplicationMaster.scala:721)
Here are my dependencies:
"org.apache.spark" %% "spark-core" % "2.3.2"% "provided",
"org.apache.spark" %% "spark-sql" % "2.3.2"% "provided",
"org.apache.phoenix" % "phoenix-core" % "4.7.0.2.6.5.102-5",
"org.apache.phoenix" % "phoenix-spark2" % "4.7.0.2.6.5.0-292"
I test to add, but It doesn't works:
"org.apache.thrift" % "libfb303" % "0.9.3"
Add this one resolve my problem: "org.apache.thrift" % "libfb303" % "0.9.2"
I'm on IntelliJ and my spark session looks like this -
val spark = SparkSession.builder()
.appName("Spark SQL")
.config("spark.master", "local")
.config("spark.sql.warehouse.dir", "src/main/resources/warehouse") //to create a user-defined warehouse for storing tables
.config("spark.network.timeout" , "10000000s")//to avoid Heartbeat exception
.getOrCreate()
While I can create a database using
spark.sql("create database newdb")
This creates a directory under src/main/resources/warehouse
However when I attempt to create a table using the same manner
spark.sql("create table testing(id int, name string)"), it fails
Exception in thread "main" org.apache.spark.sql.AnalysisException: Hive support is required to CREATE Hive TABLE (AS SELECT);;
'CreateTable `testing`, org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, ErrorIfExists
Thereafter, I did add enableHiveSupport() while creating spark session, but it also leads me to this exception
org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
Can anyone help me with this?
EDIT
This is my sbt
name := "spark-essentials"
version := "0.1"
scalaVersion := "2.12.10"
val sparkVersion = "3.0.0-preview"
val vegasVersion = "0.3.11"
val postgresVersion = "42.2.2"
resolvers ++= Seq(
"bintray-spark-packages" at "https://dl.bintray.com/spark-packages/maven",
"Typesafe Simple Repository" at "https://repo.typesafe.com/typesafe/simple/maven-releases",
"MavenRepository" at "https://mvnrepository.com"
)
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % sparkVersion,
"org.apache.spark" %% "spark-sql" % sparkVersion,
"org.apache.spark" %% "spark-hive" % sparkVersion,
// logging
"org.apache.logging.log4j" % "log4j-api" % "2.4.1",
"org.apache.logging.log4j" % "log4j-core" % "2.4.1",
// postgres for DB connectivity
"org.postgresql" % "postgresql" % postgresVersion
)
EDIT:
below is the stack trace
20:41:08 WARN ObjectStore:568 - Failed to get database default, returning NoSuchObjectException
20:41:08 WARN Hive:168 - Failed to access metastore. This class should not accessed in runtime.
org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.ql.metadata.Hive.getAllDatabases(Hive.java:1236)
at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:174)
at org.apache.hadoop.hive.ql.metadata.Hive.<clinit>(Hive.java:166)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:503)
at org.apache.spark.sql.hive.client.HiveClientImpl.newState(HiveClientImpl.scala:203)
at org.apache.spark.sql.hive.client.HiveClientImpl.<init>(HiveClientImpl.scala:127)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.spark.sql.hive.client.IsolatedClientLoader.createClient(IsolatedClientLoader.scala:300)
at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:421)
at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:314)
at org.apache.spark.sql.hive.HiveExternalCatalog.client$lzycompute(HiveExternalCatalog.scala:68)
at org.apache.spark.sql.hive.HiveExternalCatalog.client(HiveExternalCatalog.scala:67)
at org.apache.spark.sql.hive.HiveExternalCatalog.$anonfun$databaseExists$1(HiveExternalCatalog.scala:221)
at scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:23)
at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatalog.scala:99)
at org.apache.spark.sql.hive.HiveExternalCatalog.databaseExists(HiveExternalCatalog.scala:221)
at org.apache.spark.sql.internal.SharedState.externalCatalog$lzycompute(SharedState.scala:147)
at org.apache.spark.sql.internal.SharedState.externalCatalog(SharedState.scala:137)
at org.apache.spark.sql.internal.SharedState.globalTempViewManager$lzycompute(SharedState.scala:170)
at org.apache.spark.sql.internal.SharedState.globalTempViewManager(SharedState.scala:165)
at org.apache.spark.sql.hive.HiveSessionStateBuilder.$anonfun$catalog$2(HiveSessionStateBuilder.scala:56)
at org.apache.spark.sql.catalyst.catalog.SessionCatalog.globalTempViewManager$lzycompute(SessionCatalog.scala:92)
at org.apache.spark.sql.catalyst.catalog.SessionCatalog.globalTempViewManager(SessionCatalog.scala:92)
at org.apache.spark.sql.catalyst.catalog.SessionCatalog.lookupRelation(SessionCatalog.scala:741)
at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveRelations$.org$apache$spark$sql$catalyst$analysis$Analyzer$ResolveRelations$$lookupTableFromCatalog(Analyzer.scala:781)
at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveRelations$.resolveRelation(Analyzer.scala:725)
at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveRelations$$anonfun$apply$6.applyOrElse(Analyzer.scala:765)
at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveRelations$$anonfun$apply$6.applyOrElse(Analyzer.scala:757)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.$anonfun$resolveOperatorsUp$3(AnalysisHelper.scala:90)
at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:72)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.$anonfun$resolveOperatorsUp$1(AnalysisHelper.scala:90)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper$.allowInvokingTransformsInAnalyzer(AnalysisHelper.scala:194)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsUp(AnalysisHelper.scala:86)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsUp$(AnalysisHelper.scala:84)
at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.resolveOperatorsUp(LogicalPlan.scala:29)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.$anonfun$resolveOperatorsUp$2(AnalysisHelper.scala:87)
at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$mapChildren$1(TreeNode.scala:376)
at org.apache.spark.sql.catalyst.trees.TreeNode.mapProductIterator(TreeNode.scala:214)
at org.apache.spark.sql.catalyst.trees.TreeNode.mapChildren(TreeNode.scala:374)
at org.apache.spark.sql.catalyst.trees.TreeNode.mapChildren(TreeNode.scala:327)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.$anonfun$resolveOperatorsUp$1(AnalysisHelper.scala:87)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper$.allowInvokingTransformsInAnalyzer(AnalysisHelper.scala:194)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsUp(AnalysisHelper.scala:86)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsUp$(AnalysisHelper.scala:84)
at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.resolveOperatorsUp(LogicalPlan.scala:29)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.$anonfun$resolveOperatorsUp$2(AnalysisHelper.scala:87)
at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$mapChildren$1(TreeNode.scala:376)
at org.apache.spark.sql.catalyst.trees.TreeNode.mapProductIterator(TreeNode.scala:214)
at org.apache.spark.sql.catalyst.trees.TreeNode.mapChildren(TreeNode.scala:374)
at org.apache.spark.sql.catalyst.trees.TreeNode.mapChildren(TreeNode.scala:327)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.$anonfun$resolveOperatorsUp$1(AnalysisHelper.scala:87)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper$.allowInvokingTransformsInAnalyzer(AnalysisHelper.scala:194)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsUp(AnalysisHelper.scala:86)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.resolveOperatorsUp$(AnalysisHelper.scala:84)
at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.resolveOperatorsUp(LogicalPlan.scala:29)
at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveRelations$.apply(Analyzer.scala:757)
at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveRelations$.apply(Analyzer.scala:694)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$2(RuleExecutor.scala:130)
at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
at scala.collection.immutable.List.foldLeft(List.scala:89)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$1(RuleExecutor.scala:127)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$1$adapted(RuleExecutor.scala:119)
at scala.collection.immutable.List.foreach(List.scala:392)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.execute(RuleExecutor.scala:119)
at org.apache.spark.sql.catalyst.analysis.Analyzer.org$apache$spark$sql$catalyst$analysis$Analyzer$$executeSameContext(Analyzer.scala:168)
at org.apache.spark.sql.catalyst.analysis.Analyzer.execute(Analyzer.scala:162)
at org.apache.spark.sql.catalyst.analysis.Analyzer.execute(Analyzer.scala:122)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$executeAndTrack$1(RuleExecutor.scala:98)
at org.apache.spark.sql.catalyst.QueryPlanningTracker$.withTracker(QueryPlanningTracker.scala:88)
at org.apache.spark.sql.catalyst.rules.RuleExecutor.executeAndTrack(RuleExecutor.scala:98)
at org.apache.spark.sql.catalyst.analysis.Analyzer.$anonfun$executeAndCheck$1(Analyzer.scala:146)
at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper$.markInAnalyzer(AnalysisHelper.scala:201)
at org.apache.spark.sql.catalyst.analysis.Analyzer.executeAndCheck(Analyzer.scala:145)
at org.apache.spark.sql.execution.QueryExecution.$anonfun$analyzed$1(QueryExecution.scala:66)
at org.apache.spark.sql.catalyst.QueryPlanningTracker.measurePhase(QueryPlanningTracker.scala:111)
at org.apache.spark.sql.execution.QueryExecution.analyzed$lzycompute(QueryExecution.scala:63)
at org.apache.spark.sql.execution.QueryExecution.analyzed(QueryExecution.scala:63)
at org.apache.spark.sql.execution.QueryExecution.assertAnalyzed(QueryExecution.scala:55)
at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:95)
at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:607)
at part4sql.SparkSql$.delayedEndpoint$part4sql$SparkSql$1(SparkSql.scala:29)
at part4sql.SparkSql$delayedInit$body.apply(SparkSql.scala:7)
at scala.Function0.apply$mcV$sp(Function0.scala:39)
at scala.Function0.apply$mcV$sp$(Function0.scala:39)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
at scala.App.$anonfun$main$1$adapted(App.scala:80)
at scala.collection.immutable.List.foreach(List.scala:392)
at scala.App.main(App.scala:80)
at scala.App.main$(App.scala:78)
at part4sql.SparkSql$.main(SparkSql.scala:7)
at part4sql.SparkSql.main(SparkSql.scala)
Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1523)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:86)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:132)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:104)
at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3005)
at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3024)
at org.apache.hadoop.hive.ql.metadata.Hive.getAllDatabases(Hive.java:1234)
... 94 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1521)
... 100 more
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:src/main/resources/warehouse
Last line in the stacktrace --
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:src/main/resources/warehouse
-- hints that the proper way to set spark.sql.warehouse.dir is to supply an absolute path for metastore directory, something like file:///<project_root_dir>/src/main/resources/warehouse.
try including /usr/hdp/current/spark-client/conf/hive-site.xml or respective hive-site file while you submit spark.
Also you can try including below configuration when submitting spark job
--conf "spark.sql.catalogImplementation=hive" \
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"
I would like to use the apache-phoenix framework.
The problem is that I keep having an exception telling me that the class HBaseConfiguration can't be found.
Here is the code I want to use:
import org.apache.spark.SparkContext
import org.apache.spark.sql._
import org.apache.phoenix.spark._
// Load INPUT_TABLE
object MainTest2 extends App {
val sc = new SparkContext("local", "phoenix-test")
val sqlContext = new SQLContext(sc)
val df = sqlContext.load("org.apache.phoenix.spark", Map("table" -> "INPUT_TABLE",
"zkUrl" -> "localhost:3888"))
}
Here is the SBT I'm using :
name := "spark-to-hbase"
version := "1.0"
scalaVersion := "2.11.8"
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-mapreduce-client-core" % "2.3.0",
"org.apache.phoenix" % "phoenix-core" % "4.11.0-HBase-1.3",
"org.apache.spark" % "spark-core_2.11" % "2.1.1",
"org.apache.spark" % "spark-sql_2.11" % "2.1.1",
"org.apache.phoenix" % "phoenix-spark" % "4.11.0-HBase-1.3"
)
And here is the exception :
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/hadoop/hbase/HBaseConfiguration at
org.apache.phoenix.query.ConfigurationFactory$ConfigurationFactoryImpl$1.call(ConfigurationFactory.java:49)
at
org.apache.phoenix.query.ConfigurationFactory$ConfigurationFactoryImpl$1.call(ConfigurationFactory.java:46)
at
org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
at
org.apache.phoenix.util.PhoenixContextExecutor.callWithoutPropagation(PhoenixContextExecutor.java:91)
at
org.apache.phoenix.query.ConfigurationFactory$ConfigurationFactoryImpl.getConfiguration(ConfigurationFactory.java:46)
at
org.apache.phoenix.jdbc.PhoenixDriver.initializeConnectionCache(PhoenixDriver.java:151)
at
org.apache.phoenix.jdbc.PhoenixDriver.(PhoenixDriver.java:142)
at
org.apache.phoenix.jdbc.PhoenixDriver.(PhoenixDriver.java:69)
at org.apache.phoenix.spark.PhoenixRDD.(PhoenixRDD.scala:43)
at
org.apache.phoenix.spark.PhoenixRelation.schema(PhoenixRelation.scala:52)
at
org.apache.spark.sql.execution.datasources.LogicalRelation.(LogicalRelation.scala:40)
at
org.apache.spark.sql.SparkSession.baseRelationToDataFrame(SparkSession.scala:389)
at
org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:146)
at
org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:125)
at org.apache.spark.sql.SQLContext.load(SQLContext.scala:965) at
MainTest2$.delayedEndpoint$MainTest2$1(MainTest2.scala:9) at
MainTest2$delayedInit$body.apply(MainTest2.scala:6) at
scala.Function0$class.apply$mcV$sp(Function0.scala:34) at
scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:76) at
scala.App$$anonfun$main$1.apply(App.scala:76) at
scala.collection.immutable.List.foreach(List.scala:381) at
scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
at scala.App$class.main(App.scala:76) at
MainTest2$.main(MainTest2.scala:6) at MainTest2.main(MainTest2.scala)
Caused by: java.lang.ClassNotFoundException:
org.apache.hadoop.hbase.HBaseConfiguration at
java.net.URLClassLoader.findClass(URLClassLoader.java:381) at
java.lang.ClassLoader.loadClass(ClassLoader.java:424) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at
java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 26 more
I've already tried to change the HADOOP_CLASSPATH in hadoop-env.sh like it is said in this previous post.
What can I do to overcome this problem?
I found a solution to my problem. As the exception says, my compiler isn't able to find the class HBaseConfiguration. HBaseConfiguration is used inside org.apache.hadoop.hbase library and so is needed to compile. I noticed that the HBaseConfiguration class wasn't present in the org.apache.hadoop library as I thought. For the hbase 1.3.1 version installed on my PC computer, I managed to find this class in the hbase-common-1.3.1 jar located in my HBASE_HOME/lib folder.
Then I include this dependency in my built.SBT :
"org.apache.hbase" % "hbase-common" % "1.3.1"
And the Exception was gone.
I'm having a Play Framework app when throws the following error when trying to run:
[info] Set current project to inland24 (in build file:/Users/MyUser/Desktop/MyProj/)
[info] Updating {file:/Users/MyUser/Desktop/MyProj/}root...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn] * com.typesafe.akka:akka-actor_2.11:2.3.13 -> 2.4-SNAPSHOT
[warn] Run 'evicted' to see detailed eviction warnings
--- (Running the application, auto-reloading is enabled) ---
java.lang.ClassNotFoundException: akka.event.slf4j.Slf4jLoggingFilter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at akka.actor.ReflectiveDynamicAccess$$anonfun$getClassFor$1.apply(DynamicAccess.scala:67)
at akka.actor.ReflectiveDynamicAccess$$anonfun$getClassFor$1.apply(DynamicAccess.scala:66)
at scala.util.Try$.apply(Try.scala:191)
at akka.actor.ReflectiveDynamicAccess.getClassFor(DynamicAccess.scala:66)
at akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:84)
at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:612)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:143)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:127)
at play.api.libs.concurrent.ActorSystemProvider$.start(Akka.scala:291)
at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:205)
at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:61)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.core.server.DevServerStart$.mainDev(DevServerStart.scala:60)
at play.core.server.DevServerStart$.mainDevHttpMode(DevServerStart.scala:50)
at play.core.server.DevServerStart.mainDevHttpMode(DevServerStart.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at play.runsupport.Reloader$.startDevMode(Reloader.scala:223)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:100)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:53)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) java.lang.reflect.InvocationTargetException
[error] Total time: 13 s, completed Oct 9, 2015 8:06:18 PM
Here is what I have as dependency:
libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.4-SNAPSHOT"
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.1.0"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.2"
libraryDependencies += "com.typesafe.akka" %% "akka-slf4j" % "2.3.6"
scalaVersion := "2.11.6"
Is there anything that I should add?
After changing the dependency to the following:
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
resolvers += "Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/"
It worked!