Wildfly 无法部署应用程序(FileNotFoundException - 访问被拒绝)

Posted

技术标签:

【中文标题】Wildfly 无法部署应用程序(FileNotFoundException - 访问被拒绝)【英文标题】:Wildfly fails to deploy application (FileNotFoundException - Access is Denied) 【发布时间】:2016-01-14 05:58:59 【问题描述】: Wildfly 8.2.0.Final JDK 8 更新 60 日食火星更新 1 JBoss 工具 4.3.0.Final Windows 10

最近我升级了以下东西:

从 Windows 7 到 Windows 10 从 Eclipse Mars 到 Eclipse Mars 更新 1 从 JBoss Tools 4.3.0.Beta1 到 JBoss Tools 4.3.0.Final

现在,当我尝试在 Eclipse 中部署我的应用程序时,它不再工作了(有时它可以工作,但大多数时候它不工作)。升级之前一切正常,但现在我在部署应用程序时得到了这个堆栈跟踪(您在下面阅读 "Acesso negado" 表示 "Access is Denied" ):

13:18:12,452 SEVERE [javax.faces] (MSC service thread 1-7) Unable to obtain InjectionProvider from init time FacesContext. Does this container implement the Mojarra Injection SPI?
13:18:12,452 SEVERE [javax.faces] (MSC service thread 1-7) Unable to call @PreDestroy annotated methods because no InjectionProvider can be found. Does this container implement the Mojarra Injection SPI?
13:18:12,452 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-7) Critical error during deployment: : com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:752) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:349) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:221) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:193) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]
  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]
Caused by: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at java.util.concurrent.FutureTask.report(FutureTask.java:122) [rt.jar:1.8.0_60]
  at java.util.concurrent.FutureTask.get(FutureTask.java:192) [rt.jar:1.8.0_60]
  at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:739) [jsf-impl-2.2.8-jbossorg-1.jar:]
  ... 11 more
Caused by: javax.faces.FacesException: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at com.sun.faces.config.configprovider.MetaInfFacesConfigResourceProvider.getResources(MetaInfFacesConfigResourceProvider.java:135) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.config.ConfigManager$URITask.call(ConfigManager.java:1308) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.config.ConfigManager$URITask.call(ConfigManager.java:1277) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_60]
  at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:730) [jsf-impl-2.2.8-jbossorg-1.jar:]
  ... 11 more
Caused by: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at java.io.FileInputStream.open0(Native Method) [rt.jar:1.8.0_60]
  at java.io.FileInputStream.open(FileInputStream.java:195) [rt.jar:1.8.0_60]
  at java.io.FileInputStream.<init>(FileInputStream.java:138) [rt.jar:1.8.0_60]
  at org.jboss.vfs.spi.RealFileSystem$1.run(RealFileSystem.java:107) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.spi.RealFileSystem$1.run(RealFileSystem.java:105) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_60]
  at org.jboss.vfs.spi.RealFileSystem.doIoPrivileged(RealFileSystem.java:87) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.spi.RealFileSystem.openInputStream(RealFileSystem.java:105) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:258) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.VirtualJarInputStream.openCurrent(VirtualJarInputStream.java:227) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.VirtualJarInputStream.getNextJarEntry(VirtualJarInputStream.java:113) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.VirtualJarInputStream.getNextEntry(VirtualJarInputStream.java:84) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at com.sun.faces.facelets.util.Classpath.searchFromURL(Classpath.java:221) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.facelets.util.Classpath.searchFromURL(Classpath.java:241) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.facelets.util.Classpath.search(Classpath.java:155) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.facelets.util.Classpath.search(Classpath.java:109) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.config.configprovider.MetaInfFacesConfigResourceProvider.loadURLs(MetaInfFacesConfigResourceProvider.java:164) [jsf-impl-2.2.8-jbossorg-1.jar:]
  at com.sun.faces.config.configprovider.MetaInfFacesConfigResourceProvider.getResources(MetaInfFacesConfigResourceProvider.java:108) [jsf-impl-2.2.8-jbossorg-1.jar:]
  ... 15 more


13:18:12,454 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./gruposemailservidores: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./gruposemailservidores: Failed to start service
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]
  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:222)
  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
  ... 3 more
Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:280)
  at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
  at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:193)
  ... 7 more
Caused by: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:752)
  at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:349)
  at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:221)
  ... 9 more
Caused by: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at java.util.concurrent.FutureTask.report(FutureTask.java:122) [rt.jar:1.8.0_60]
  at java.util.concurrent.FutureTask.get(FutureTask.java:192) [rt.jar:1.8.0_60]
  at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:739)
  ... 11 more
Caused by: javax.faces.FacesException: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at com.sun.faces.config.configprovider.MetaInfFacesConfigResourceProvider.getResources(MetaInfFacesConfigResourceProvider.java:135)
  at com.sun.faces.config.ConfigManager$URITask.call(ConfigManager.java:1308)
  at com.sun.faces.config.ConfigManager$URITask.call(ConfigManager.java:1277)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_60]
  at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:730)
  ... 11 more
Caused by: java.io.FileNotFoundException: C:\wildfly\standalone\tmp\vfs\temp\temp4de141261078fbde\gruposemailservidores.war-18ba5e3d2b4062a2\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
  at java.io.FileInputStream.open0(Native Method) [rt.jar:1.8.0_60]
  at java.io.FileInputStream.open(FileInputStream.java:195) [rt.jar:1.8.0_60]
  at java.io.FileInputStream.<init>(FileInputStream.java:138) [rt.jar:1.8.0_60]
  at org.jboss.vfs.spi.RealFileSystem$1.run(RealFileSystem.java:107) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.spi.RealFileSystem$1.run(RealFileSystem.java:105) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_60]
  at org.jboss.vfs.spi.RealFileSystem.doIoPrivileged(RealFileSystem.java:87) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.spi.RealFileSystem.openInputStream(RealFileSystem.java:105) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:258) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.VirtualJarInputStream.openCurrent(VirtualJarInputStream.java:227) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.VirtualJarInputStream.getNextJarEntry(VirtualJarInputStream.java:113) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at org.jboss.vfs.VirtualJarInputStream.getNextEntry(VirtualJarInputStream.java:84) [jboss-vfs-3.2.5.Final.jar:3.2.5.Final]
  at com.sun.faces.facelets.util.Classpath.searchFromURL(Classpath.java:221)
  at com.sun.faces.facelets.util.Classpath.searchFromURL(Classpath.java:241)
  at com.sun.faces.facelets.util.Classpath.search(Classpath.java:155)
  at com.sun.faces.facelets.util.Classpath.search(Classpath.java:109)
  at com.sun.faces.config.configprovider.MetaInfFacesConfigResourceProvider.loadURLs(MetaInfFacesConfigResourceProvider.java:164)
  at com.sun.faces.config.configprovider.MetaInfFacesConfigResourceProvider.getResources(MetaInfFacesConfigResourceProvider.java:108)
  ... 15 more


13:18:12,460 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) JBAS014613: Operation ("full-replace-deployment") failed - address: ([]) - failure description: "JBAS014671: Failed services" => "jboss.undertow.deployment.default-server.default-host./gruposemailservidores" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./gruposemailservidores: Failed to start service
    Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\\wildfly\\standalone\\tmp\\vfs\\temp\\temp4de141261078fbde\\gruposemailservidores.war-18ba5e3d2b4062a2\\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
    Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\\wildfly\\standalone\\tmp\\vfs\\temp\\temp4de141261078fbde\\gruposemailservidores.war-18ba5e3d2b4062a2\\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
    Caused by: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\\wildfly\\standalone\\tmp\\vfs\\temp\\temp4de141261078fbde\\gruposemailservidores.war-18ba5e3d2b4062a2\\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
    Caused by: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.io.FileNotFoundException: C:\\wildfly\\standalone\\tmp\\vfs\\temp\\temp4de141261078fbde\\gruposemailservidores.war-18ba5e3d2b4062a2\\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
    Caused by: javax.faces.FacesException: java.io.FileNotFoundException: C:\\wildfly\\standalone\\tmp\\vfs\\temp\\temp4de141261078fbde\\gruposemailservidores.war-18ba5e3d2b4062a2\\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)
    Caused by: java.io.FileNotFoundException: C:\\wildfly\\standalone\\tmp\\vfs\\temp\\temp4de141261078fbde\\gruposemailservidores.war-18ba5e3d2b4062a2\\gruposemailservidores.war-3630318317622662798.tmp (Acesso negado)"
13:18:12,527 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018565: Replaced deployment "gruposemailservidores.war" with deployment "gruposemailservidores.war"
13:18:12,528 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.persistenceunit."gruposemailservidores.war#ufca" (unavailable) dependents: [service jboss.deployment.unit."gruposemailservidores.war".deploymentCompleteService]
JBAS014777:   Services which failed to start:      service jboss.undertow.deployment.default-server.default-host./gruposemailservidores
      service jboss.undertow.deployment.default-server.default-host./gruposemailservidores: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./gruposemailservidores: Failed to start service

我已经检查了上面提到的文件夹的 Windows 权限,似乎一切都很好。

P.S.:交叉发布:https://developer.jboss.org/thread/263854

【问题讨论】:

你是否以管理员身份运行过eclipse? 我在 Windows 中的用户帐户是管理员帐户。 没关系。当您专门以这种方式启动程序时,您只是以管理员身份运行程序。 在升级之前一切正常,即使没有以管理员身份运行 Eclipse。如果我尝试在 Eclipse 中作为一个运行,我将需要再次安装所有插件。我不想走这条路线来解决这个问题,因为我认为这与此无关。 然后尝试将 C:\wildfly\ 的权限授予所有人 【参考方案1】:

Windows“拒绝访问”错误不仅与权限不足有关,还与另一个进程获得的排他锁有关。您应该检查哪些进程锁定了您的文件。您可以为此任务使用“解锁”程序。就我而言,防病毒软件锁定了临时文件。

【讨论】:

【参考方案2】:

如果您不使用 JSF 框架,您可以从您的配置 (standalone.xml) 中删除这些行:

<extension module="org.jboss.as.jsf"/> 

<subsystem xmlns="urn:jboss:domain:jsf:1.0"/>

对我来说,它解决了问题。

【讨论】:

也为我工作,应该是公认的答案。 @Max 和 Joao,你能详细说明一下这个选项吗?即使这解决了问题,我也想知道为什么会这样。 @SuhasD:我真的很抱歉,但 5 年后我不记得确切的原因了。此外,这肯定是 WildFly 10.0.0.Final 充其量......我怀疑当前版本(例如最近的 23.0.0.Final)可能会有不同的表现。【参考方案3】:

Windows Defender 的实时保护也可能引发访问被拒绝错误。将 Wildfly 文件夹添加到 Defender 的排除列表中。

【讨论】:

【参考方案4】:

我将 IntelliJ 与 JBoss EAP 一起使用,但它失败了,就像您的错误一样(拒绝访问)。 所以我关闭了我的病毒防护(MSE),问题就解决了。

【讨论】:

以上是关于Wildfly 无法部署应用程序(FileNotFoundException - 访问被拒绝)的主要内容,如果未能解决你的问题,请参考以下文章

在 Wildfly 的战争部署期间无法访问 jar 中的类

在 Wildfly 中部署的 Spring Boot 应用程序“无法实例化 WebApplicationInitializer 类”

Wildfly + Eclipse 部署扫描程序

我从Wildfly中删除了ExampleDS。现在我无法部署我的应用程序,因为我遇到了这样的错误。有什么提示吗?

Spring Boot 2 重新部署到 Wildfly 10 后无法刷新 JMS 连接

主机无法访问 Wildfly 容器