【问题标题】:Cannot deploy EAR on WildFly 8.2.1.Final无法在 WildFly 8.2.1.Final 上部署 EAR
【发布时间】:2015-11-06 06:29:51
【问题描述】:

我在尝试部署 EAR 时在 Wildfly 上遇到以下错误:

[standalone@IP:9990 /] deploy /opt/banco_ear.ear
{"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"banco_ear.ear\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"banco_ear.ear\".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment \"banco_ear.ear\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018740: Failed to mount deployment content
    Caused by: java.io.IOException: VFS000015: Could not create directory for original name 'content' after 10 attempts"}}}}

EAR 由 Intellij IDEA 生成,我修复了所有依赖项。我是远程部署的新手,我觉得这很困难。

这是我的 application.xml

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd"
             version="6">

    <module id="banco-Web">
        <web>
            <web-uri>web.war</web-uri>
            <context-root>bancoWeb</context-root>
        </web>
    </module>
</application>

怎么了?

提前致谢。

编辑

当我以 wildfly 用户身份运行 jboss-cli 并尝试部署应用程序(在本地 wildfly 运行时完美),CLI 抛出下一个异常:

[standalone@IP:9990 /] deploy /opt/prueba_ear.ear
{"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"prueba_ear.ear\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"prueba_ear.ear\".WeldStartService: Failed to start service
    Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:96)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78)
    at org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:129)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:306)
    at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:284)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:262)
    at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:271)
    at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:260)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:148)
    at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:54)
    at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:42)
    at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:61)
    at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:420)
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)
    at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:93)
    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)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessError: tried to access method com.sun.faces.flow.FlowCDIContext.<init>(Ljava/util/Map;)V from class com.sun.faces.flow.FlowCDIExtension
    at com.sun.faces.flow.FlowCDIExtension.afterBeanDiscovery(FlowCDIExtension.java:76)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
    ... 21 more
"}}}}

【问题讨论】:

  • 这在我看来就像执行 wildfly 的用户没有写入或创建它的临时和/或工作目录的权限

标签: jakarta-ee deployment intellij-idea wildfly ear


【解决方案1】:

如果文件是远程部署的,则部署会转到 WILDFLY_HOME/standalone/data/content 而不是 WILDFLY_HOME/standalone/deployments,并且会在 standalone.xml 中创建部署条目,如下所示。

 <deployments>
        <deployment name="My-Project.ear" runtime-name="My-Project.ear">
            <content sha1="fb085ab4a36109125517bbe79e3af645170b7814"/>
        </deployment>
 </deployments>

wildfly 用户(或正在执行部署的任何用户)似乎没有对 WILDFLY_HOME/standalone/data/content 文件夹的写入权限。

【讨论】:

  • 感谢您的回答。我在服务器中以 root 身份登录,并以 root 身份运行 ./jboss-cli.sh 。但是如果我以 wildfly 用户身份运行 jboss-cli,服务器会返回另一个异常错误。第一篇文章是正文。
  • @Nico: 好像wildfly用户没有访问权限,你可以在linux中使用chmod命令来更改权限。在独立文件夹上运行 chmod 777 将是最简单的选择。有关详细信息,请参阅此链接maketecheasier.com/file-permissions-what-does-chmod-777-means
  • 我将 wildfly 主文件夹的权限更改为 777。仍然抛出了我在第一个帖子编辑部分中指定的相同异常。 ¿ 什么是WeldStartService 异常?
猜你喜欢
  • 2018-07-26
  • 2016-12-04
  • 2016-12-12
  • 2017-04-16
  • 2014-08-16
  • 2014-04-22
  • 1970-01-01
  • 2012-11-15
  • 2012-02-16
相关资源
最近更新 更多