当前位置: 首页 > 工具软件 > ApacheDS > 使用案例 >

ApacheDS WINDOWS上安装后服务启动失败

段干华晖
2023-12-01

INFO   | jvm 1    | 2022/11/21 20:47:46 | java.nio.file.NoSuchFileException: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\tempks2198018802773906173ks
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at java.nio.file.Files.newByteChannel(Files.java:361)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at java.nio.file.Files.createFile(Files.java:632)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at java.nio.file.TempFileHelper.create(TempFileHelper.java:138)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:161)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at java.nio.file.Files.createTempFile(Files.java:897)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at org.apache.directory.server.core.security.CertificateUtil.createTempKeyStore(CertificateUtil.java:318)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at org.apache.directory.server.ApacheDsService.start(ApacheDsService.java:219)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at org.apache.directory.server.ApacheDsService.start(ApacheDsService.java:152)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at org.apache.directory.server.wrapper.ApacheDsTanukiWrapper.start(ApacheDsTanukiWrapper.java:175)
INFO   | jvm 1    | 2022/11/21 20:47:46 |     at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788)
STATUS | wrapper  | 2022/11/21 20:47:48 | <-- Wrapper Stopped

解决方案:

在apacheds安装的目录下ApacheDS\instances\default新建一个tmp文件夹,然后在

ApacheDS\conf下wrapper.conf文件最下面一行新增一行:

wrapper.java.additional.6=-Djava.io.tmpdir="%INSTANCE_DIRECTORY%/tmp"

其中tmp可以修改成别的

参考:

I tested this change (since it made it into the lastest version of ApaceDS server) and it is still not working on Windows 2008 when running as a service, but the problem is not the length of the path but the ability to write the temp directory. On my system the TEMP & TMP environment variables are set to:

%SystemRoot%\TEMP for System and for User is it %USERPROFILE%\AppData\Local\Temp.

Since the ApacheDS service is running as "Local System account" I would assume it would be trying to write to %SystemRoot%\TEMP. For whatever reason (and I can think of a few) ApacheDS can't create a temp file in that folder.

I fixed by creating a tmp folder in the instance directory and added the following line to wrapper.conf:

wrapper.java.additional.6=-Djava.io.tmpdir="%INSTANCE_DIRECTORY%/tmp"

That fixed the problem. I think it would be better if ApacheDS explicitly set it's temp folder to someplace it controlled and knew it could write to. A sys admin that wanted the files somewhere else could make a symlink or change the wrapper.conf. Those temp files contain ldap data so it would be better from a security standpoint to keep them with the rest of the instance data. If the instance is going to have its own log folder it might as well have its own temp directory.

链接:

windows-7-x64 - 启动Apache DS时出现问题 - Thinbug

 类似资料: