简体   繁体   中英

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

OS: Windows 7 64bit

java version: 1.7.0_17

javac Version: 1.7.0_17

I'm new to Play Framework, basically wanted to get a feel of everything.

There's a sample application called 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. It seems like you have encountered this issue , which looks to be a JVM bug on your flavour of Windows.

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). 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.

As a workaround add

 -Dfile.separator=\/

parameter to play.bat and build.bat.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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