错误 [org.jboss.msc.service.fail](MSC 服务线程 1-3)MSC000001:无法启动服务 jboss.deployment.unit。 .POST_MODULE
Posted
技术标签:
【中文标题】错误 [org.jboss.msc.service.fail](MSC 服务线程 1-3)MSC000001:无法启动服务 jboss.deployment.unit。 .POST_MODULE【英文标题】:ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit. .POST_MODULE 【发布时间】:2016-11-09 07:34:37 【问题描述】:帮助! 我想部署我有这个错误:
22:50:45,854 错误 [org.jboss.msc.service.fail](MSC 服务线程 1-1)MSC000001:无法启动服务 jboss.undertow.deployment.default-server.default-host./opciondefensa .UndertowDeploymentInfoService: org.jboss.msc.service.StartException 在服务 jboss.undertow.deployment.default-server.default-host./opciondefensa.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet 来自 [来自服务模块加载器的模块“deployment.opciondefensa.war:main”] 在 org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:1066) 在 org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:281) 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 在 java.lang.Thread.run(Thread.java:745) 引起:java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet from [Module "deployment.opciondefensa.war:main" from Service Module Loader] 在 org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198) 在 org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363) 在 org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351) 在 org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93) 在 org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:721) ... 6 更多
22:50:45,860 错误 [org.jboss.as.controller.management-operation](控制器引导线程)WFLYCTL0013:操作(“部署”)失败 - 地址:([(“部署”=>“opciondefensa.战争")]) - 失败描述:"WFLYCTL0080: 失败的服务" => "jboss.undertow.deployment.default-server.default-host./opciondefensa.UndertowDeploymentInfoService" => "org.jboss.msc.service.服务 jboss.undertow.deployment.default-server.default-host./opciondefensa.UndertowDeploymentInfoService 中的 StartException:java.lang.ClassNotFoundException:org.springframework.web.servlet.DispatcherServlet 来自 [Module \"deployment.opciondefensa.war:main\ "来自服务模块加载器] 引起:java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet from [Module \"deployment.opciondefensa.war:main\" from Service Module Loader]"
**
MY POM BELOW 也有同样的麻烦。
**
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cl.legal</groupId>
<artifactId>opciondefensa</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>opciondefensa Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>4.2.5.RELEASE</spring.version>
<jstl.version>1.2</jstl.version>
<tiles.version>3.0.1</tiles.version>
<hibernate.version>4.3.5.Final</hibernate.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.6.1</slf4j.version>
<logback.version>0.9.26</logback.version>
<postgresql.version>9.4.1208</postgresql.version>
<javax.version>3.1.0</javax.version>
<jsp.version>2.1</jsp.version>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>$slf4j.version</version>
<scope>provided</scope>
</dependency>
<!-- SERVLET -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>$javax.version</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>$jsp.version</version>
<scope>provided</scope>
</dependency>
<!-- JSTL -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>$jstl.version</version>
<scope>provided</scope>
</dependency>
<!-- SPRING FRAMEWORK -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>$spring.version</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>$spring.version</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>$spring.version</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>$spring.version</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>$spring.version</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>$spring.version</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>$spring.version</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.springframework</groupId> -->
<!-- <artifactId>spring-test</artifactId> -->
<!-- <version>$spring.version</version> -->
<!-- <scope>provided</scope> -->
<!-- </dependency> -->
<!-- ORM HIBERNATE [JPA] -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>$hibernate.version</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>$hibernate.version</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.1.0.Final</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>dom4j</groupId> -->
<!-- <artifactId>dom4j</artifactId> -->
<!-- <version>1.6.1</version> -->
<!-- <scope>provided</scope> -->
<!-- </dependency> -->
<!-- postgres Connector-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>$postgresql.version</version>
<scope>provided</scope>
</dependency>
<!-- Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-extras</artifactId>
<version>$tiles.version</version>
</dependency>
<!-- Apache Commons Upload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.1.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-base</artifactId>
<version>2.4.4</version>
</dependency>
<!-- Log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>$log4j.version</version>
</dependency>
</dependencies>
<build>
<finalName>opciondefensa</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>$java.version</source>
<target>$java.version</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
【问题讨论】:
你的代码呢? 不要写很多代码,只通过启动配置项目...... 【参考方案1】:很明显
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
你尝试使用 spring,但你没有将它包含在你的战争中。
查看您的opciondefensa.war
中包含哪些罐子
为什么spring-mvc
的范围是provided
?
【讨论】:
修改谢谢!!,pero si no los tuviera como los agrego? 我不明白。如果这对您有帮助,请接受我的回答并用英文写下您的问题:) 好的,请不要说英语,非常抱歉,其他我已经格式化了我的电脑...我有一点...仍然需要重新访问。 跟着我的麻烦,现在不要为什么... buuu!! @user6558875 请删除 spring-mvc 依赖项提供的范围【参考方案2】:这样做,
项目右键->属性->部署程序集->添加 -> java buildpath entries -> 选择 maven build path library -> apply -> ok.
希望它能解决您的问题。
【讨论】:
以上是关于错误 [org.jboss.msc.service.fail](MSC 服务线程 1-3)MSC000001:无法启动服务 jboss.deployment.unit。 .POST_MODULE的主要内容,如果未能解决你的问题,请参考以下文章
org.jboss.classfilewriter.DuplicateMemberException
JBOSS启动报错Failed to start service jboss.web.deployment.default-host.
从 JBoss AS 7.1 迁移到 JBoss EAP 7.3.0
remote://localhost:9999. The connection timed out