简体   繁体   English

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

[英]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\文件夹复制到tomeeconf\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 directory AppData\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.

相关问题 尝试将文件从一个文件夹复制到JAVA中的临时文件夹时出错[拒绝访问]? - Error while trying to copy the file from one folder to a temp folder in JAVA [Access Denied]? FileNotFoundException:从 .txt 文件加载数据时“访问被拒绝” - FileNotFoundException: “Access is denied” when loading data from .txt file java.io.FileNotFoundException:临时(访问被拒绝) - java.io.FileNotFoundException: Temp (Access is denied) 在context.xml中使用两个DataSource的用户“root”@“localhost”访问被拒绝 - Access denied for user 'root'@'localhost' with two DataSources in context.xml Wildfly无法部署应用程序(FileNotFoundException - 拒绝访问) - Wildfly fails to deploy application (FileNotFoundException - Access is Denied) 尝试复制使用 JGit 拉取的文件时出现“拒绝访问”消息 - “Access Denied” Message when trying to copy file(s) pulled with JGit 尝试写入新文件时,FileNotFoundException(拒绝访问) - FileNotFoundException (Access is denied) when trying to write to a new file 上传文件时java.io.FileNotFoundException(路径)(访问被拒绝) - java.io.FileNotFoundException (path)(Access is denied) when uploading file 使用JAXB编组到File时,接收FileNotFoundException(访问被拒绝) - Receiving FileNotFoundException (Access is denied) when using JAXB to marshal to File 从Temp文件夹打开文件时拒绝权限 - Permmission denied while opening file from Temp folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM