簡體   English   中英

Play Framework運行應用程序問題

[英]Play Framework Run Application Issue

每當我嘗試運行使用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.

在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" %*

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" %*

剛剛在我的Windows 8計算機上下載並解壓縮了2.2.1。

遵循Play Framework網站上的文檔,最終遇到了與您相同的問題。 調整構建文件中的各種參數沒有做任何事情,但是:

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" %*

......解決了這個問題。 我不知道其他人在哪里找到了這個解決方案,但Play Framework網站上沒有提到這個解決方案。 事實上,沒有任何跡象表明任何事情都可能出錯。 畢竟,它只是一個你需要解壓縮的文件。

它現在正在運行,但有點難以相信早期搞砸的框架。 似乎作者除了Linux之外沒有測試任何東西。

在2.3 Play框架中:

    GO to : 

C://Play2.3/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”%*

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”%*

然后在命令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

如果您無法執行此命令,則在Windows路徑中的環境變量中設置play2.3框架路徑。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM