有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

scala无法将带有java项目的Play框架打包到war中

大家好,我正在尝试在AWS EC2实例上部署我的应用程序。为此,我让tomcat服务器在那里运行。我想从这个游戏项目中创建一个war文件。eclipse中没有显示任何错误。我的项目目录是play userReg:

C:\playdemo>play war play-userReg -o myapp.war
~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.3.x-1.3.0RC1, http://www.playframework.org
~
~ Warning: no application.mode defined in you conf/application.conf. Using DEV mode.
Listening for transport dt_socket at address: 8000
14:25:36,029 INFO  ~ Starting C:\playdemo\play-userReg
14:25:36,431 INFO  ~ Precompiling ...
14:25:37,969 ERROR ~

@6keg3pk9m
Cannot start in PROD mode with errors

Compilation error (In /app/Global.java around line 8)
The file /app/Global.java could not be compiled. Error raised is : GlobalSettings cannot be resolved to a type

play.exceptions.CompilationException: GlobalSettings cannot be resolved to a type
        at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:256)
        at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:679)
        at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:523)
        at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:292)
        at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:427)
        at play.Play.preCompile(Play.java:604)
        at play.Play.init(Play.java:308)
        at play.server.Server.main(Server.java:160)
~ Please fix compilation errors before packaging WAR
~

我的身材。sbt文件是:

name := """play-userReg"""

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
    "com.typesafe.play" %% "play" % "2.3.0" % "provided",
    "org.springframework" % "spring-core" % "3.2.2.RELEASE",
    "org.springframework" % "spring-context" % "3.2.2.RELEASE",
    "org.mongodb" % "mongo-java-driver" % "2.11.0",
    "org.springframework.data" % "spring-data-mongodb" % "1.2.0.RELEASE",
    "cglib" % "cglib" % "2.2.2",
    javaCore,
    javaJdbc,
    javaEbean
)

lazy val root = (project in file(".")).enablePlugins(PlayJava)

共 (1) 个答案

  1. # 1 楼答案

    看起来你正试图用Play 1构建一个Play 2项目

    你应该运行“激活器”而不是“播放”