我无法运行 Play Framework 应用程序。以下是申请详情:
- 播放框架 2.5.0
- SBT 0.3.11
- 斯卡拉 2.11.7
SBT 中的依赖关系
object Dependencies { // Repositories val resolutionRepos = Seq( "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/", "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases", "Atlassian Releases" at "https://maven.atlassian.com/public/", "Couchbase Maven repository" at "http://files.couchbase.com/maven2", "Maven Repository" at "https://repo1.maven.org/maven2", "MVN Repository" at "http://central.maven.org/maven2", Resolver.sonatypeRepo("snapshots"), Resolver.sonatypeRepo("releases"), Resolver.url("sbt snapshot plugins", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns), Resolver.url("mcveat.github.com", url("http://mcveat.github.com/releases"))(Resolver.ivyStylePatterns) ) // Versions object V { val Activation = "1.1.1" val Akka = "2.4.2" val AkkaQuartz = "1.4.0-akka-2.3.x" val AwsScala = "0.5.3" val CommonIo = "2.4" val CommonNet = "3.3" val CommonCodec = "1.10" val CommonMail = "1.4.7" val CommonLang = "3.4" val CouchbaseClient = "2.1.6" val CouchbaseCore = "1.1.6" val Dispatch = "0.11.3" val Elastic4s = "1.7.4" val Fluentlenium = "0.10.3" val Guice = "4.0" val Guava = "19.0" val Inject = "1" val HttpClient = "4.3.6" val HttpCore = "4.3.3" val Jackson = "2.7.1" val Jerkson = "0.6.7" val JodaTime = "2.9.2" val JodaConvert = "1.8.1" val Junit = "4.12" val LiftJson = "2.6.2" val Logback = "1.1.4" val Mockito = "1.10.8" val Netty = "4.0.34.Final" val PlayMailer = "3.0.1" val PostgresDriver = "9.4-1206-jdbc42" val ScalaGuice = "4.0.0" val ScalaTest = "2.2.4" val ScalaPlayTest = "1.4.0-M3" val ScalaVersion = "2.11.7" val ScalaModules = "1.0.3" val Selenium = "2.45.0" val Silhouette = "4.0.0-BETA1" val Slf4j = "1.7.16" val Spec2 = "2.3.12" val Spray = "1.3.3" val SprayJson = "1.3.2" val TypeSafeConfig = "1.3.0" val TypeSafePlay = "2.5.0" } val activation = "javax.activation" % "activation" % V.Activation val akkaActor = "com.typesafe.akka" %% "akka-actor" % V.Akka val akkaKernel = "com.typesafe.akka" %% "akka-kernel" % V.Akka val akkaQuartz = "com.enragedginger" %% "akka-quartz-scheduler" % V.AkkaQuartz val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % V.Akka val akkaTestKit = "com.typesafe.akka" %% "akka-testkit" % V.Akka % "test" val awsScala = "com.github.seratch" %% "awscala" % V.AwsScala val commonIo = "commons-io" % "commons-io" % V.CommonIo val commonNet = "commons-net" % "commons-net" % V.CommonNet val commonCodec = "commons-codec" % "commons-codec" % V.CommonCodec val commonMail = "javax.mail" % "mail" % V.CommonMail val couchbaseClient = "com.couchbase.client" % "java-client" % V.CouchbaseClient val couchbaseCore = "com.couchbase.client" % "core-io" % V.CouchbaseCore exclude("com.fasterxml", "*") val commonLang = "org.apache.commons" % "commons-lang3" % V.CommonLang val dispatch = "net.databinder.dispatch" % "dispatch-core_2.11" % V.Dispatch exclude("org.scala-stm", "scala-stm_2.10.0") val elastic4s = "com.sksamuel.elastic4s" %% "elastic4s-core" % V.Elastic4s val email = "play.modules.mail" %% "play2-mail-plugin" % "0.6" val fluentlenium = "org.fluentlenium" % "fluentlenium-core" % V.Fluentlenium % "test" val fluentleniumFest = "org.fluentlenium" % "fluentlenium-festassert" % V.Fluentlenium % "test" val guice = "com.google.inject" % "guice" % V.Guice val guava = "com.google.guava" % "guava" % V.Guava val inject = "javax.inject" % "javax.inject" % V.Inject val httpClient = "org.apache.httpcomponents" % "httpclient" % V.HttpClient val httpCore = "org.apache.httpcomponents" % "httpcore" % V.HttpCore val jacksonCore = "com.fasterxml.jackson.core" % "jackson-core" % V.Jackson val jacksonBind = "com.fasterxml.jackson.core" % "jackson-databind" % V.Jackson val jacksonAnnotation = "com.fasterxml.jackson.core" % "jackson-annotations" % V.Jackson val jacksonDataType = "com.fasterxml.jackson.datatype" % "jackson-datatype-jdk8" % V.Jackson val jdbcPostgres = "org.postgresql" % "postgresql" % V.PostgresDriver val jerkson = "com.gilt" % "jerkson_2.11" % V.Jerkson exclude("org.scala-stm", "scala-stm_2.10.0") exclude("play", "*") val jodaConvert = "org.joda" % "joda-convert" % V.JodaConvert val jodaTime = "joda-time" % "joda-time" % V.JodaTime val junit = "junit" % "junit" % V.Junit % "test" val liftJson = "net.liftweb" %% "lift-json" % V.LiftJson val liftJsonExt = "net.liftweb" %% "lift-json-ext" % V.LiftJson val logbackCore = "ch.qos.logback" % "logback-core" % V.Logback val logbackClassic = "ch.qos.logback" % "logback-classic" % V.Logback val mockito = "org.mockito" % "mockito-core" % V.Mockito % "test" val scalaGuice = "net.codingwell" %% "scala-guice" % V.ScalaGuice val scalaTest = "org.scalatest" %% "scalatest" % V.ScalaTest % "test" val scalaPlayTest = "org.scalatestplus" %% "play" % V.ScalaPlayTest % "test" val selenium = "org.seleniumhq.selenium" % "selenium-java" % V.Selenium % "test" val silhouette = "com.mohiva" %% "play-silhouette" % V.Silhouette val silhouettePasswordBCrypt = "com.mohiva" %% "play-silhouette-password-bcrypt" % V.Silhouette val silhouetteTestKit = "com.mohiva" %% "play-silhouette-testkit" % V.Silhouette % "test" val slf4j = "org.slf4j" % "slf4j-api" % V.Slf4j val sprayCan = "io.spray" %% "spray-can" % V.Spray val sprayHttp = "io.spray" %% "spray-http" % V.Spray val sprayJson = "io.spray" %% "spray-json" % V.SprayJson val sprayRouting = "io.spray" %% "spray-routing" % V.Spray val sprayTests = "io.spray" %% "spray-testkit" % V.Spray % "test" val specs2Core = "org.specs2" %% "specs2-core" % V.Spec2 val specs2JUnit = "org.specs2" %% "specs2-junit" % V.Spec2 % "test" val specs2Matcher = "org.specs2" %% "specs2-matcher" % V.Spec2 % "test" val specs2Mock = "org.specs2" %% "specs2-mock" % V.Spec2 % "test" val typeSafeConfig = "com.typesafe" % "config" % V.TypeSafeConfig val typeSafePlayCache = "com.typesafe.play" %% "play-cache" % V.TypeSafePlay val typeSafePlayDb = "com.typesafe.play" %% "play-jdbc" % V.TypeSafePlay val typeSafePlayDbApi = "com.typesafe.play" %% "play-jdbc-api" % V.TypeSafePlay val typeSafePlayEvolutions = "com.typesafe.play" %% "play-jdbc-evolutions" % V.TypeSafePlay val typeSafePlayFilter = "com.typesafe.play" %% "filters-helpers" % V.TypeSafePlay val typeSafePlayJson = "com.typesafe.play" %% "play-json" % V.TypeSafePlay val typeSafePlayMailer = "com.typesafe.play" %% "play-mailer" % V.PlayMailer val typeSafePlayTest = "com.typesafe.play" %% "play-test" % V.TypeSafePlay // Dependencies to be overriden due to some libraries are the latest version of each lazy val overrideDependencies = Set( activation, akkaActor, akkaSlf4j, akkaTestKit, commonCodec, commonLang, commonMail, guava, httpClient, httpCore, jacksonAnnotation, jacksonBind, jacksonCore, jacksonDataType, jodaConvert, jodaTime, junit, logbackCore, logbackClassic, slf4j, typeSafeConfig, typeSafePlayCache, typeSafePlayJson, "commons-logging" % "commons-logging" % "1.2", "com.ning" % "async-http-client" % "1.9.21", "net.sourceforge.htmlunit" % "htmlunit" % "2.20", "io.netty" % "netty" % "3.10.1.Final", "io.netty" % "netty-all" % V.Netty, "io.netty" % "netty-codec-http" % V.Netty, "io.netty" % "netty-handler" % V.Netty, "io.netty" % "netty-transport" % V.Netty, "io.netty" % "netty-buffer" % V.Netty, "io.netty" % "netty-common" % V.Netty, "com.google.code.findbugs" % "jsr305" % "3.0.1", "org.bouncycastle" % "bcprov-jdk15on" % "1.51", "org.javassist" % "javassist" % "3.20.0-GA", "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4", "org.scala-lang.modules" %% "scala-xml" % "1.0.4", "com.typesafe.play" %% "play" % V.TypeSafePlay, "com.typesafe.play" %% "play-netty-server" % V.TypeSafePlay, "com.typesafe.play" %% "play-server" % V.TypeSafePlay, "xml-apis" % "xml-apis" % "1.4.01" ) }
插件.sbt
// Scoverage Plugin addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.1.0") // SBT Native Packager addSbtPlugin("com.typesafe.sbt" %% "sbt-native-packager" % "1.0.2") // Play Plugin addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.0") // Assembly Plugin addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2") addSbtPlugin("com.jamesward" % "play-auto-refresh" % "0.0.13")
构建.scala
object TIBuild extends Build { import BuildSettings._ import Dependencies._ // configure prompt to show current project override lazy val settings = super.settings :+ { shellPrompt := { s => "[TI PROJECT] " + Project.extract(s).currentProject.id + " > " } } BrowserNotifierKeys.shouldOpenBrowser := false JsEngineKeys.engineType := JsEngineKeys.EngineType.Node //... Multi projects description here, nothing significant to this issue ... }
reference.conf 中的部分配置(应用程序中没有 application.conf):
play.server { netty { transport = "native" } }
这个 jar netty-transport-native-epoll-4.0.33.Final-linux-x86_64.jar在 dist 文件的“/lib”文件夹中可用(作为传递依赖项)。
但是,当我在登台服务器(Ubuntu 14.0.4)中运行该应用程序时,出现此错误:
Exception in thread "main" java.lang.NoClassDefFoundError: io/netty/channel/epoll/EpollDatagramChannel$DatagramSocketAddress
ti-portal-1 | 2016-03-18T07:06:35.675317263Z at java.lang.ClassLoader$NativeLibrary.load(Native Method)
ti-portal-1 | 2016-03-18T07:06:35.675447058Z at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
ti-portal-1 | 2016-03-18T07:06:35.675583984Z at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
ti-portal-1 | 2016-03-18T07:06:35.675698092Z at java.lang.Runtime.load0(Runtime.java:809)
ti-portal-1 | 2016-03-18T07:06:35.675823281Z at java.lang.System.load(System.java:1086)
ti-portal-1 | 2016-03-18T07:06:35.675943125Z at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:193)
ti-portal-1 | 2016-03-18T07:06:35.676114343Z at io.netty.channel.epoll.Native.(Native.java:48)
ti-portal-1 | 2016-03-18T07:06:35.676239448Z at io.netty.channel.epoll.EpollEventArray.(EpollEventArray.java:40)
ti-portal-1 | 2016-03-18T07:06:35.676448982Z at io.netty.channel.epoll.EpollEventLoop.(EpollEventLoop.java:66)
ti-portal-1 | 2016-03-18T07:06:35.677077555Z at io.netty.channel.epoll.EpollEventLoopGroup.newChild(EpollEventLoopGroup.java:76)
ti-portal-1 | 2016-03-18T07:06:35.677223247Z at io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:64)
ti-portal-1 | 2016-03-18T07:06:35.677354357Z at io.netty.channel.MultithreadEventLoopGroup.(MultithreadEventLoopGroup.java:49)
ti-portal-1 | 2016-03-18T07:06:35.677547627Z at io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:61)
ti-portal-1 | 2016-03-18T07:06:35.677719684Z at io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:49)
ti-portal-1 | 2016-03-18T07:06:35.677842651Z at play.core.server.NettyServer.(NettyServer.scala:74)
ti-portal-1 | 2016-03-18T07:06:35.678233662Z at play.core.server.NettyServerProvider.createServer(NettyServer.scala:266)
ti-portal-1 | 2016-03-18T07:06:35.678384523Z at play.core.server.NettyServerProvider.createServer(NettyServer.scala:265)
ti-portal-1 | 2016-03-18T07:06:35.678501026Z at play.core.server.ServerProvider$class.createServer(ServerProvider.scala:25)
ti-portal-1 | 2016-03-18T07:06:35.678623815Z at play.core.server.NettyServerProvider.createServer(NettyServer.scala:265)
ti-portal-1 | 2016-03-18T07:06:35.678734335Z at play.core.server.ProdServerStart$.start(ProdServerStart.scala:53)
ti-portal-1 | 2016-03-18T07:06:35.678842600Z at play.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
ti-portal-1 | 2016-03-18T07:06:35.679050486Z at play.core.server.ProdServerStart.main(ProdServerStart.scala)
ti-portal-1 | 2016-03-18T07:06:35.679298166Z Caused by: java.lang.ClassNotFoundException: io.netty.channel.epoll.EpollDatagramChannel$DatagramSocketAddress
ti-portal-1 | 2016-03-18T07:06:35.679410387Z at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
ti-portal-1 | 2016-03-18T07:06:35.679522334Z at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
ti-portal-1 | 2016-03-18T07:06:35.679632600Z at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
ti-portal-1 | 2016-03-18T07:06:35.679775126Z at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
ti-portal-1 | 2016-03-18T07:06:35.680094183Z ... 22 more
尝试谷歌但没有找到解决这个问题的方法。任何解决此问题的建议/建议将不胜感激。