致命错误:无法在smartFoxServer中创建日志文件

时间:2015-01-04 16:57:53

标签: flash flash-builder smartfoxserver smartfox

最近,我尝试将smartFoxServer用于我的新项目。 问题是在安装之后,我尝试启动smartFoxServer,并写下这个:

|------------------------------------------------------------|
|                      SmartFoxServer                        |
|                Multiplayer Socket Server                   |
|                      version 1.5.5                         |
|                           ---                              |
|              (c) 2004 - 2007 gotoAndPlay()                 |
|                  www.smartfoxserver.com                    |
|                    www.gotoandplay.it                      |
|------------------------------------------------------------|

java.nio.file.InvalidPathException: Illegal char <:> at index 2: \C:\Users\Ariel
PC\Documents\SmartFoxServerBASIC_1.5.5\Server\logs\smartfox_log_0.txt.lck
        at sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
        at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
        at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
        at sun.nio.fs.WindowsPath.parse(Unknown Source)
        at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
        at java.nio.file.Paths.get(Unknown Source)
        at java.util.logging.FileHandler.openFiles(Unknown Source)
        at java.util.logging.FileHandler.<init>(Unknown Source)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.initLogger(SmartFoxServe
r.java:495)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
585)
FATAL ERROR: Could not create log files.


Shutting down server...

Press any key to continue . . .

我该如何解决?服务器无法正常工作!

感谢!

1 个答案:

答案 0 :(得分:2)

我认为问题与 Java版有关,因为SmartFoxServer不支持 JRE 8 。因此,为了避免此问题,您可以下载并安装 JRE 6 JRE 7 ,然后打开文件SmartFoxServerBASIC_1.5.5\Server\start.bat并对其进行编辑(我们只会更改) java路径):

@"path_of_jre\bin\java.exe" -cp "./;/;./lib/nanoxml-2.2.1.jar;./lib/js.jar;./lib/jython.jar;./lib/commons-pool-1.2.jar;./lib/commons-dbcp-1.2.1.jar;./lib/commons-collections-3.1.jar;./lib/activation.jar;./lib/javamail/smtp.jar;./lib/javamail/mailapi.jar;./lib/jetty/jetty.jar;./lib/jetty/jetty-util.jar;./lib/jetty/servlet-api-2.5.jar;./lib/jetty/multipartrequest.jar;./lib/json.jar;./lib/xbean.jar;./lib/jsr173_1.0_api.jar;./lib/concurrent.jar;./lib/jysfs.jar;" -Dfile.encoding=UTF-8 -Djava.util.logging.config.file=logging.properties it.gotoandplay.smartfoxserver.SmartFoxServer
@pause

path_of_jre是您的JRE目录的路径,例如:C:\Program Files\Java\jre7

使用三个版本的Java查看我的测试:1.8,1.7和1.6:

Java版本1.8.0:

java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
|------------------------------------------------------------|
|                      SmartFoxServer                        |
|                Multiplayer Socket Server                   |
|                      version 1.5.5                         |
|                           ---                              |
|              (c) 2004 - 2007 gotoAndPlay()                 |
|                  www.smartfoxserver.com                    |
|                    www.gotoandplay.it                      |
|------------------------------------------------------------|

java.nio.file.InvalidPathException: Illegal char <:> at index 2: \C:\Users\zo\Sm
artFoxServerBASIC_1.5.5\Server\logs\smartfox_log_0.txt.lck
        at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
        at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
        at java.nio.file.Paths.get(Paths.java:84)
        at java.util.logging.FileHandler.openFiles(FileHandler.java:438)
        at java.util.logging.FileHandler.<init>(FileHandler.java:354)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.initLogger(SmartFoxServe
r.java:495)
        at it.gotoandplay.smartfoxserver.SmartFoxServer.run(SmartFoxServer.java:
585)
FATAL ERROR: Could not create log files.

Shutting down server...

Java版本1.7.0_65:

java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
|------------------------------------------------------------|
|                      SmartFoxServer                        |
|                Multiplayer Socket Server                   |
|                      version 1.5.5                         |
|                           ---                              |
|              (c) 2004 - 2007 gotoAndPlay()                 |
|                  www.smartfoxserver.com                    |
|                    www.gotoandplay.it                      |
|------------------------------------------------------------|

--- [ System Info ] ------------------------------------------

System CPU(s): 4
VM Max memory: 1431 MB

os.name: Windows 7
os.arch: amd64
os.version: 6.1
java.version: 1.7.0_65
java.vendor: Oracle Corporation
java.vendor.url: http://java.oracle.com/
java.vm.specification.version: 1.7
java.vm.version: 24.65-b04
java.vm.vendor: Oracle Corporation
java.vm.name: Java HotSpot(TM) 64-Bit Server VM

--- [ Network Cards ] -----------------------------------------
...
--- [ Licence Loaded ] ------------------------------------

Licence Type: BASIC
Licenced to : --== Free Demo License ==--
Max. Clients: 20

--- [ Zones & Rooms ] -------------------------------------
...
--- [ Server Starting ] ---------------------------------

Server address: 127.0.0.1
Server port   : 9339

22:05:39.295 - [ INFO ] > [EventWriter] ..... started :: 1 thread(s)
22:05:39.320 - [ INFO ] > [SystemHandler] ... started :: 1 thread(s)
22:05:39.321 - [ INFO ] > [ExtensionHandler]. started :: 1 thread(s)
22:05:39.321 - [ INFO ] > [DeadChannelsPolicy: strict]
22:05:39.322 - [ INFO ] > Server is up and running!

Java版本1.6.0_45:

java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
|------------------------------------------------------------|
|                      SmartFoxServer                        |
|                Multiplayer Socket Server                   |
|                      version 1.5.5                         |
|                           ---                              |
|              (c) 2004 - 2007 gotoAndPlay()                 |
|                  www.smartfoxserver.com                    |
|                    www.gotoandplay.it                      |
|------------------------------------------------------------|

--- [ System Info ] ------------------------------------------

System CPU(s): 4
VM Max memory: 1431 MB

os.name: Windows 7
os.arch: amd64
os.version: 6.1
java.version: 1.6.0_45
java.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
java.vm.specification.version: 1.0
java.vm.version: 20.45-b01
java.vm.vendor: Sun Microsystems Inc.
java.vm.name: Java HotSpot(TM) 64-Bit Server VM

--- [ Network Cards ] -----------------------------------------
...
--- [ Licence Loaded ] ------------------------------------

Licence Type: BASIC
Licenced to : --== Free Demo License ==--
Max. Clients: 20

--- [ Zones & Rooms ] -------------------------------------
...
--- [ Server Starting ] ---------------------------------

Server address: 127.0.0.1
Server port   : 9339

22:09:07.578 - [ INFO ] > [EventWriter] ..... started :: 1 thread(s)
22:09:07.593 - [ INFO ] > [SystemHandler] ... started :: 1 thread(s)
22:09:07.594 - [ INFO ] > [ExtensionHandler]. started :: 1 thread(s)
22:09:07.594 - [ INFO ] > [DeadChannelsPolicy: strict]
22:09:07.594 - [ INFO ] > Server is up and running!

希望所有可以帮到你的事。