gpt4 book ai didi

java - 部署时,netbeans 无法将上下文 xml 文件从临时文件夹复制到 tomee 的本地主机。 FileNotFoundException(访问被拒绝)

转载 作者:行者123 更新时间:2023-12-01 23:52:26 25 4
gpt4 key购买 nike

netbeans 无法复制上下文 xml文件来自AppData\Local\Temp\文件夹到tomeeconf\Catalina\localhost部署时。

已经尝试过:

deploy to tomee 7.0.X is fine but tomee 8.0.0 fail.

stderr.log 中的 fatal error :

03-Oct-2019 16:31:22.358 fatal [http-nio-9200-exec-6] org.apache.catalina.startup.ExpandWar.copy Error copying [C:\Users\xxx\AppData\Local\Temp\context2716699461818377726.xml] to [D:\Tomee\apache-tomee-plus-8.0.0\conf\Catalina\localhost\myApp.xml] java.io.FileNotFoundException: C:\Users\xxx\AppData\Local\Temp\context2716699461818377726.xml (Access is denied.) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at org.apache.catalina.startup.ExpandWar.copy(ExpandWar.java:276)

最佳答案

This problem only occurs when Tomee is running as a Windows service.
I tested version 7.0.4~8.0.0 to get the following conclusions.

The Tomee runs the service with the LocalSystem account before version 7.0.6.
Starting with version 7.0.6, the service is run with the LocalService account, so that the permissions are insufficient.

The following two ways can solve the issue:
- Give the LocalService account access to the directory AppData\Local\Temp\.
- Specifying the Tomee runs the service with the LocalSystem account when installing the service.
   service install %serviceName% --service-user LocalSystem

关于java - 部署时,netbeans 无法将上下文 xml 文件从临时文件夹复制到 tomee 的本地主机。 FileNotFoundException(访问被拒绝),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58215599/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com