[英]netbeans unable to copy context xml file from temp folder to tomee's localhost when deploy. FileNotFoundException(access denied)
netbeans unable to copy context
xml
file from AppData\Local\Temp\
folder to tomee
's conf\Catalina\localhost
when deploy. netbeans 部署时无法将上下文
xml
文件从AppData\Local\Temp\
文件夹复制到tomee
的conf\Catalina\localhost
。
already tried:已经尝试过:
deploy to tomee 7.0.X is fine but tomee 8.0.0 fail.
fatal error in stderr.log
: stderr.log
中的致命错误:
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(Expa
2019 年 10 月 3 日 16:31:22.358 致命 [http-nio-9200-exec-6] org.apache.catalina.startup.ExpandWar.copy 复制错误 [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(Expa ndWar.java:276)
ndWar.java:276)
This problem only occurs when Tomee is running as a Windows service.
仅当 Tomee 作为 Windows 服务运行时,才会出现此问题。
I tested version 7.0.4~8.0.0 to get the following conclusions.我测试了7.0.4~8.0.0版本,得到以下结论。
The Tomee runs the service with the LocalSystem account before version 7.0.6.Tomee 使用版本 7.0.6 之前的 LocalSystem 帐户运行服务。
Starting with version 7.0.6, the service is run with the LocalService account, so that the permissions are insufficient.从7.0.6版本开始,服务使用LocalService账号运行,权限不足。
The following two ways can solve the issue:以下两种方法可以解决问题:
- Give the LocalService account access to the directoryAppData\Local\Temp\
.- 授予 LocalService 帐户对目录
AppData\Local\Temp\
的访问权限。
- Specifying the Tomee runs the service with the LocalSystem account when installing the service.- 安装服务时,指定 Tomee 使用 LocalSystem 帐户运行服务。
service install %serviceName% --service-user LocalSystem
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.