我对使用服务器不太熟悉。 我使用的是 Windows 11。 我刚刚从 https://glassfish.org/download.html 下载 glassfish7 然后我解压它并运行命令
./asadmin start-domain
在 C:\Program Files\Glassfish\glassfish7\bin
我收到此错误消息:
java.nio.file.AccessDeniedException: C:\Program Files\Glassfish\glassfish7\glassfish\domains\domain1\logs\server.log.lck
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:119)
at java.base/java.nio.channels.FileChannel.open(FileChannel.java:309)
at java.base/java.nio.channels.FileChannel.open(FileChannel.java:369)
at java.logging/java.util.logging.FileHandler.openFiles(FileHandler.java:512)
at java.logging/java.util.logging.FileHandler.<init>(FileHandler.java:342)
at com.sun.enterprise.admin.launcher.GFLauncherLogger.addLogFileHandler(GFLauncherLogger.java:131)
at com.sun.enterprise.admin.launcher.GFLauncher.setup(GFLauncher.java:306)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.createLauncher(StartDomainCommand.java:225)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.executeCommand(StartDomainCommand.java:128)
at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:294)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:322)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:259)
at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:32)
Waiting for domain1 to start ............................................................
Waiting finished after 60,000 ms.
No response from the Domain Administration Server (domain1) after 60 seconds.
The command is either taking too long to complete or the server has failed.
Please see the server log files for command status.
Please start with the --verbose option in order to see early messages.
Command start-domain failed.
\domains\domain1\logs 目录完全是空的。
GlassFish 似乎没有创建该文件的权限
\domains\domain1\logs\server.log.lck
。您是否使用拥有 GlassFish 安装的同一用户运行 GlassFish?你能检查一下是否可以在\domains\domain1\logs\
中手动创建文件吗?