简体   繁体   English

Play框架2:尝试在生产模式下启动应用程序时出错

[英]Play framework 2: Error when trying to start application in production mode

OS: Windows 7 64bit 操作系统:Windows 7 64位

java version: 1.7.0_17 java版本:1.7.0_17

javac Version: 1.7.0_17 javac版本:1.7.0_17

I'm new to Play Framework, basically wanted to get a feel of everything. 我是Play Framework的新手,基本上想要了解一切。

There's a sample application called java/helloworld. 有一个名为java / helloworld的示例应用程序。 Haven't changed anything and went on using the "start" command. 没有改变任何东西,继续使用“开始”命令。

[helloworld] $ start

(Starting server. Type Ctrl+D to exit logs, the server will remain in background
)

Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at java.lang.System.initializeSystemClass(Unknown Source)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range:
 0
        at java.lang.String.charAt(Unknown Source)
        at java.io.Win32FileSystem.<init>(Unknown Source)
        at java.io.WinNTFileSystem.<init>(Unknown Source)
        at java.io.FileSystem.getFileSystem(Native Method)
        at java.io.File.<clinit>(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at java.lang.System.initializeSystemClass(Unknown Source)

I don't think this is anything to do with Play. 我不认为这与Play有任何关系。 It seems like you have encountered this issue , which looks to be a JVM bug on your flavour of Windows. 看起来你遇到过这个问题 ,它看起来像是你的Windows风格的JVM错误。

To run the sample applications in production mode, you may have to proceed as follows: 要在生产模式下运行示例应用程序,您可能必须按以下步骤操作:

  1. Run the play stage command (outside the Play console, just on the command line). 运行play stage命令(在Play控制台外部,仅在命令行上)。 The stage task is described here 阶段任务在此处描述
  2. Add this JVM argument to the target\\start script generated by the stage task, before then starting the application. 将此JVM参数添加到stage任务生成的target\\start脚本,然后启动应用程序。

As a workaround add 作为解决方法添加

 -Dfile.separator=\/

parameter to play.bat and build.bat. play.bat和build.bat的参数。

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

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