我已经使用eclipse neon开发了一个Spring MVC4应用程序。在那之后,我点击右键进入Run As-> Run on Server,我选择了Tomcat server,web应用程序运行良好。但是,当我通过选择Wildfly 10.1.0服务器执行相同的操作时,我得到了Http错误404。
Wildfly web管理控制台运行良好。
在POM文件中,我建立了jsp-api和servlet-api依赖关系:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>compile</scope>
</dependency>Wildfly日志如下:
2017-04-08 18:44:18,415 INFO [org.jboss.as.repository] (External Management Request Threads -- 4) WFLYDR0001: Content added at location C:\Users\Usuario\wildfly-10.1.0.Final\standalone\data\content\c8\74cc39ed9cfeb6494c4908333714c394e43957\content
2017-04-08 18:44:18,436 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "SpringMyBatis-master.war" (runtime-name: "SpringMyBatis-master.war")
2017-04-08 18:44:24,457 WARN [org.jboss.as.ee] (MSC service thread 1-3) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
2017-04-08 18:44:24,458 WARN [org.jboss.as.ee] (MSC service thread 1-3) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
2017-04-08 18:44:24,534 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
2017-04-08 18:44:24,536 WARN [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0003: Unable to instantiate driver class "org.olap4j.driver.xmla.XmlaOlap4jDriver": java.lang.NoSuchMethodException: org.olap4j.driver.xmla.XmlaOlap4jDriver.<init>()
2017-04-08 18:44:24,577 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0018: Started Driver service with driver-name = SpringMyBatis-master.war_com.mysql.jdbc.Driver_5_1
2017-04-08 18:44:26,494 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 69) Inicializando Mojarra 2.2.13.SP1 20160303-1204 para el contexto '/SpringMyBatis-master'
2017-04-08 18:44:29,665 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 69) WFLYUT0021: Registered web context: /SpringMyBatis-master
2017-04-08 18:44:29,729 INFO [org.jboss.as.server] (External Management Request Threads -- 4) WFLYSRV0010: Deployed "SpringMyBatis-master.war" (runtime-name : "SpringMyBatis-master.war")在这种情况下,它缺少什么?谢谢
发布于 2017-04-08 16:39:06
右键单击您的项目。在下拉菜单中选择
properties->Run time ->并选择wildfly作为目标运行时。
按apply
现在运行您的项目.Now部署您的web应用程序并运行.It即可工作
发布于 2017-04-11 16:21:30
您的两个依赖项应该在提供的而不是编译的作用域中,否则它们最终会出现在您的war文件中,这是不正确的。您永远不应该将Java EE API jars放在应用程序中。
https://stackoverflow.com/questions/43290525
复制相似问题