简体   繁体   中英

netbeans unable to copy context xml file from temp folder to tomee's localhost when deploy. FileNotFoundException(access denied)

already tried:

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

fatal error in 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 ndWar.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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM