簡體   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