Maven结合jetty产生的问题

1.No result defined for action XXX and result XXX

如果配置没问题的话则可能是Struts2-Convention-Plugin.jar这个包引起的。

这个包是实现Struts零配置功能的。他会扫描你的所有action、actions、struts 、struts包下含有execute方法的类。并根据其类名建立xxx.action映射。这时候当你访问XXX.action时系统会首先调用零配置方法配置的action,而这时候你又没有使用注解配置其result。当然就报找不到no result啦。 

 

结论就是如果你既用了XML配置和零配置。零配置的各种信息会覆盖XML的。

解决办法。1、如果你的action类名是XXXAction 请不要在XML配置中设置其action name属性为XXX

               2、使用零配置

              3、去掉Struts2-Convention-Pluginx.xx.jar这个包

2.Ignoring command with incorrect key

 修改stop port即可

 <plugin>
	<groupId>org.eclipse.jetty</groupId>
	<artifactId>jetty-maven-plugin</artifactId>
	<version>9.3.0.M2</version>
	 <configuration>
		<webApp>
			<contextPath>/</contextPath>
		</webApp>
		<stopKey>stop</stopKey>
		<stopPort>8000</stopPort>
	</configuration>  
</plugin> 
3.No Spring WebApplicationInitializer types detected on classpath
在web.xmi添加红色部分

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"
 metadata-complete="true" >
   <absolute-ordering/>

4.java.lang.ArrayIndexOutOfBoundsException thrown on jetty startup

最新版本jdk8要使用asm5.0.1+,且将插件org.mortbay.jetty换成org.eclipse.jetty具体可参考这个链接:

http://stackoverflow.com/questions/26496338/strange-java-lang-arrayindexoutofboundsexception-thrown-on-jetty-startup

 <plugin>
	<groupId>org.eclipse.jetty</groupId>
	<artifactId>jetty-maven-plugin</artifactId>
	<version>9.3.0.M2</version>
 <configuration>
		<webApp>
			<contextPath>/</contextPath>
		</webApp>
		<stopKey>sp</stopKey>
		<stopPort>8000</stopPort>
	</configuration>  
</plugin> 
		<!-- 	<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<version>8.1.16.v20140903</version>
				<configuration>
					<webApp>
						<contextPath>/</contextPath>
					</webApp>
					<connectors>
						<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
							<port>8086</port>
							<maxIdleTime>60000</maxIdleTime>
						</connector>
					</connectors>
				</configuration>
			</plugin>  -->


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值