struts2-2.5.10使用struts2-convention-plugin启动后报错,求高手指教
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.5.10</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>2.5.10</version>
</dependency>
启动后报错信息:
java.lang.IncompatibleClassChangeError: class org.apache.struts2.convention.DefaultClassFinder$InfoBuildingVisitor has interface org.objectweb.asm.ClassVisitor as super class
看这错误信息的意思是:DefaultClassFinder$InfoBuildingVisitor 这个类把 org.objectweb.asm.ClassVisitor 这个接口当做父类来继承了,但是我看了struts2-convention-plugin-2.5.10.jar里的这个类的源码:
public class InfoBuildingVisitor extends ClassVisitor
这里它是继承了ClassVisitor这个类,但这个ClassVisitor类在asm-5.1.jar包中是个抽象类,并非接口!源码如下:
public abstract class ClassVisitor
我就很不明白为什么会包这个错误!
另外我用2.3.31版本的struts2就不会有任何问题!
相关推荐
Struts2 Convention Plugin中文文档 Annotion
原文:http://cwiki.apache.org/WW/convention-plugin.html 翻译:石太祥 Introduction 从struts2.1版本开始,Convention Plugin作为替换替换Codebehind Plugin来实现Struts2的零配置。 • 包命名习惯来指定Action位置 • 命名习惯制定结果(支持JSP,FreeMarker等)路径 • 类名到URL的约定转换 • 包名到命名空间(namespace)的约定转换 • 遵循SEO规范的链接地址(即:使用my-action 来替代 MyAction) • 基于注解的Action名 • 基于注解的拦截机(Interceptor) • 基于注解的命名空间(Nameespace) • 基于注解的XWork包 • 默认action以及默认的结果(比如:/products 将会尝试寻找com.example.actions.Products 或 com.example.actions.products.Index进行处理) 无需配置Convention即可使用Convention,Convention的某些约束习惯可以通过配置属性来控制,您也可以在类中覆写其中的方法 来达到扩展目地
Struts2_Convention_Plugin中文文档
Struts2_Convention_Plugin中文文档
struts2采用convention-plugin实现零配置
struts2采用convention-plugin实现零配置,讲述如何不通过配置文件搭建struts2
struts2零配置convention-plugin
从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行配置,甚至不需要使用Annotation进行配置,而是由struts2根据约定自动配置
Struts2.1零配置——convention-plugin
从struts2.1版本开始,Convention Plugin作为替换替换Codebehind Plugin来实现Struts2的零配置。


