Java jboss eap-6.1 无法处理部署 \"education.war\" 的阶段 POST_MODULE
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20593683/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
jboss eap-6.1 Failed to process phase POST_MODULE of deployment \"education.war\"
提问by Makute.two
Used hibernate, spring mvc. Files:
使用hibernate,spring mvc。文件:
web.xml
网页.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>
main context file
主上下文文件
<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>
root-context.xml
根上下文.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>
Before i successuly compile and run this application, then add hibernate code and this xml files and meet error.
在我成功编译并运行此应用程序之前,添加休眠代码和此 xml 文件并遇到错误。
Error code
错误代码
16:40:50,403 ERROR [org.jboss.as.server] (management-handler-thread - 12) JBAS015870: Deploy of deployment "education.war" was rolled back with the following failure message: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"education.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"education.war\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"education.war\" Caused by: java.lang.LinkageError: Failed to link org/springframework/web/filter/GenericFilterBean (Module \"deployment.education.war:main\" from Service Module Loader) Caused by: java.lang.NoClassDefFoundError: org/springframework/context/EnvironmentAware Caused by: java.lang.ClassNotFoundException: org.springframework.context.EnvironmentAware from [Module \"deployment.education.war:main\" from Service Module Loader]"}} 16:40:50,533 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment education.war (runtime-name: education.war) in 130ms
16:40:50,403 错误 [org.jboss.as.server] (management-handler-thread - 12) JBAS015870:部署“education.war”的部署已回滚,并显示以下失败消息:{“JBAS014671:服务失败” => {"jboss.deployment.unit.\"education.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"education.war\".POST_MODULE: JBAS018733:无法处理部署 \"education.war\" 的阶段 POST_MODULE 导致:java.lang.LinkageError:无法链接 org/springframework/web/filter/GenericFilterBean (Module \"deployment.education.war:main\"来自服务模块加载器)导致:java.lang.NoClassDefFoundError:org/springframework/context/EnvironmentAware 导致:java.lang。ClassNotFoundException: org.springframework.context.EnvironmentAware from [Module \"deployment.education.war:main\" from Service Module Loader]"}} 16:40:50,533 INFO [org.jboss.as.server.deployment] (MSC服务线程 1-7) JBAS015877:在 130 毫秒内停止部署education.war(运行时名称:education.war)
采纳答案by Kevin Bowersox
This line in the stacktrace says it all:
堆栈跟踪中的这一行说明了一切:
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/EnvironmentAware Caused by: java.lang.ClassNotFoundException: org.springframework.context.EnvironmentAware
引起:java.lang.NoClassDefFoundError:org/springframework/context/EnvironmentAware 引起:java.lang.ClassNotFoundException:org.springframework.context.EnvironmentAware
You need to add spring-context
to your pom.xml file if using Maven:
spring-context
如果使用 Maven,则需要添加到 pom.xml 文件中:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
Note the version may vary depending on your project
请注意,版本可能因您的项目而异
回答by rsh
I agree with Kevin that in your case the class files are missing. So you will have to place the JARs containing these class files. However I have faced this problem on Linux servers. The problem was related to file permission issue. In this case it was difficult to catch the issue as the error messages or logs didn't clearly indicate the problem. Usually Linux is good when it comes to permission issue. I was creating the WAR files as root user but was running jboss server as jboss user. Finally I had to "sudo -su jboss" (user with which Jboss server was running) and create/deploy my artifacts.
我同意凯文的看法,在你的情况下,类文件丢失了。因此,您必须放置包含这些类文件的 JAR。但是我在 Linux 服务器上遇到了这个问题。该问题与文件权限问题有关。在这种情况下,很难发现问题,因为错误消息或日志没有明确指出问题所在。通常 Linux 在权限问题上是好的。我以 root 用户身份创建 WAR 文件,但以 jboss 用户身份运行 jboss 服务器。最后,我不得不“sudo -su jboss”(运行 Jboss 服务器的用户)并创建/部署我的工件。