简体   繁体   English

Play Framework运行应用程序问题

[英]Play Framework Run Application Issue

I am getting the following error whenever i am trying to run a new Web Application created using Play . 每当我尝试运行使用Play创建的新Web应用程序时,我都会收到以下错误。

Error occurred during initialization of VM
Could not reserve enough space for object heap

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

In Play framework 2.0.3, <play framework install dir>\\framework\\build.bat script you need to replace the command line argument for the command below 在Play framework 2.0.3中, <play framework install dir>\\framework\\build.bat脚本需要替换下面命令的命令行参数

java -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*

Into

java -XX:+CMSClassUnloadingEnabled %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*

Just downloaded and unzipped 2.2.1 on my Windows 8 computer. 刚刚在我的Windows 8计算机上下载并解压缩了2.2.1。

Followed the documentation at Play Framework website, and ended up having the same issue as you. 遵循Play Framework网站上的文档,最终遇到了与您相同的问题。 Adjusting the various parameters in the build file didn't do anything, but the: 调整构建文件中的各种参数没有做任何事情,但是:

java -XX:+CMSClassUnloadingEnabled %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*

... solved the problem. ......解决了这个问题。 I don't know where other people found this solution, but there's no mentioning of this solution on the Play Framework website. 我不知道其他人在哪里找到了这个解决方案,但Play Framework网站上没有提到这个解决方案。 In fact, there's nothing to suggest that anything could go wrong. 事实上,没有任何迹象表明任何事情都可能出错。 After all, it's just a file you need to unzip. 毕竟,它只是一个你需要解压缩的文件。

It's running now, however it's a little hard to trust a framework that screws up that early on. 它现在正在运行,但有点难以相信早期搞砸的框架。 Seems the authors don't test on anything but Linux. 似乎作者除了Linux之外没有测试任何东西。

in 2.3 Play framework : 在2.3 Play框架中:

    GO to : 

C://Play2.3/framework/build.bat and open this file and make these changes. C://Play2.3/framework/build.bat并打开此文件并进行这些更改。 Replace this line with below line. 用下面的行替换这一行。

java -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\\repository" -Dplay.home="%~dp0." java -Xms512M -Xmx1024M -Xss1M -XX:+ CMSClassUnloadingEnabled -XX:MaxPermSize = 256M%DEBUG_PARAM%-Dfile.encoding = UTF8 -Dplay.version =“%PLAY_VERSION%” - Dsbt.ivy.home =“%~dp0 .. \\ repository“-Dplay.home =”%~dp0。“ -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\\sbt-launch.jar" %* -Dsbt.boot.properties =“file:///%p%sbt/sbt.boot.properties”-jar“%~dp0sbt \\ sbt-launch.jar”%*

java -XX:+CMSClassUnloadingEnabled %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\\repository" -Dplay.home="%~dp0." java -XX:+ CMSClassUnloadingEnabled%DEBUG_PARAM%-Dfile.encoding = UTF8 -Dplay.version =“%PLAY_VERSION%” - Dsbt.ivy.home =“%~dp0 .. \\ repository”-Dplay.home =“%~dp0 “。 -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\\sbt-launch.jar" %* -Dsbt.boot.properties =“file:///%p%sbt/sbt.boot.properties”-jar“%~dp0sbt \\ sbt-launch.jar”%*

then type this command on command promt: 然后在命令promt上输入以下命令:

       C:\Users\k.ashish\Downloads\play-2.2.3\play-2.2.3\yourapp>play

        C:\Users\k.ashish\Downloads\play-2.2.3\play-2.2.3\yourapp>run

If you are not able to execute this command then set the play2.3 framework path in Environment variable in windows like java path . 如果您无法执行此命令,则在Windows路径中的环境变量中设置play2.3框架路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM