繁体   English   中英

jboss eap-6.1无法处理部署“ education.war”的阶段POST_MODULE

[英]jboss eap-6.1 Failed to process phase POST_MODULE of deployment \“education.war\”

二手的冬眠,春天的MVC。 文件:

web.xml中

    <web-app version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <display-name>Spring MVC Application</display-name>
<filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <servlet>
        <servlet-name>mvc-dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>*.css</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>*.js</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>*.gif</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>*.jpg</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>*.png</url-pattern>
    </servlet-mapping>
</web-app>

主上下文文件

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"

        >
    <context:component-scan base-package="com.education"/>
    <context:component-scan base-package="com.education.controllers"/>

    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/pages/"/>
        <property name="suffix" value=".jsp"/>
    </bean>
    <mvc:annotation-driven />
    <mvc:resources mapping="/resources/**" location="/resources/" />
    <import resource="root-context.xml" />
</beans>

根的context.xml

<?xml  version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang"
       xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
        http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">


    <context:annotation-config />


    <context:component-scan base-package="com.education.Dao" />
    <context:component-scan base-package="com.education.Service" />

    <import resource="data.xml" />


    <import resource="security.xml" />

</beans>

在成功编译并运行该应用程序之前,请添加休眠代码和此xml文件并遇到错误。

错误代码

16:40:50,403错误[org.jboss.as.server](管理处理程序线程-12)JBAS015870:回退了部署“ education.war”的部署,并显示以下失败消息:{“ JBAS014671:失败的服务” => {“ jboss.deployment.unit。\\” education.war \\“。POST_MODULE” =>“服务jboss.deployment.unit。\\” education.war \\“。POST.MODULE中的” org.jboss.msc.service.StartException“: JBAS018733:无法处理部署\\“ education.war \\”的阶段POST_MODULE,原因:java.lang.LinkageError:无法链接org / springframework / web / filter / GenericFilterBean(模块\\“ deployment.education.war:main \\”由Service Module Loader提供)由:java.lang.NoClassDefFoundError:org / springframework / context / EnvironmentAware由:java.lang.ClassNotFoundException:org.springframework.context.EnvironmentAware from [Module \\“ deployment.education.war:main \\ “来自服务模块加载程序]“}} 16:40:50,533信息[org.jboss.as.server.deployment](MSC服务线程1-7)JBAS015877:停止了部署教育。 ime-name:education.war)在130毫秒内

stacktrace中的这一行说明了一切:

引起原因:java.lang.NoClassDefFoundError:org / springframework / context / EnvironmentAware引起原因:java.lang.ClassNotFoundException:org.springframework.context.EnvironmentAware

如果使用Maven,则需要将spring-context添加到pom.xml文件中:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>3.1.3.RELEASE</version>
</dependency>

请注意,版本可能会因项目而异

我同意Kevin的观点,在您的情况下,类文件丢失了。 因此,您将不得不放置包含这些类文件的JAR。 但是我在Linux服务器上遇到了这个问题。 该问题与文件权限问题有关。 在这种情况下,由于错误消息或日志未明确指示问题,因此很难抓住问题。 通常,在权限问题上,Linux很好。 我以root用户身份创建WAR文件,但以jboss用户身份运行jboss服务器。 最后,我不得不“ sudo -su jboss”(运行Jboss服务器的用户)并创建/部署我的工件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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