我是Play框架的新手。这里我正在做与数据库连接的项目。我已经尝试使用MySql并获得了成功的输出。但我无法连接 Hive JDBC 。
以下是我所做的更改。
build.scala
name := "SAI"
version := "1.0-SNAPSHOT"
libraryDependencies ++= Seq(
"org.apache.hive" % "hive-jdbc" % "0.13.0",
Jdbc,
javaEbean,
cache,
"org.slf4j" % "slf4j-api" % "1.7.5",
"ch.qos.logback" % "logback-classic" % "1.0.13",
"org.apache.commons" % "commons-email" % "1.3.2",
"org.apache.hive" % "hive-exec" % "0.13.0",
"org.apache.hive" % "hive-metastore" % "0.13.0",
"org.apache.hive" % "hive-service" % "0.13.0",
"org.apache.thrift" % "libfb303" % "0.9.1",
"log4j" % "log4j" % "1.2.17",
"org.apache.hadoop" % "hadoop-core" % "1.2.1"
)
play.Project.playJavaSettings
application.conf
db.default.driver=org.apache.hive.jdbc.HiveDriver
db.default.url="jdbc:hive2://localhost:10000/test"
ebean.default="models.*"
尝试连接时,我收到以下错误
! @6o8kokmi3 - Internal server error, for (GET) [/] ->
Configuration error: Configuration error[Cannot connect to database [default]]
at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:92)
at play.api.Configuration.reportError(Configuration.scala:570)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:243)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(enter code hereTraversable.scala:105)
at play.api.db.BoneCPPlugin.onStart(DB.scala:243)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at scala.collection.immutable.List.foreach(List.scala:318)
at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
at play.api.Play$.start(Play.scala:87)`enter code here`
请让我知道我错过的任何事情,并提前致谢