我有一個Struts2應用程序,最初是基於XML的,但現在我第一次引入了基於Annotation的操作,應用在啓動時崩潰了。
考慮下面的動作映射,對應用程序的啓動,我得到的錯誤
java.lang.InstantiationError: com.opensymphony.xwork2.util.finder.ClassFinder
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:390)
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:347)
at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:199)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:906)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:486)
at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:75)
at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:63)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
有此類似的問題,但沒有人迴應, Issue with Struts2 Filter Exception
用於圖書館:
- struts2-convention-plugin-2.3.14.3.jar
- struts2的核 - 2.5.10.1.jar
- struts2的-JSON-插件-2.5.10.1.jar
- struts2的 - 彈簧 - 插件-2.5.10.1.jar
- struts2的瓷磚-插件-2.5。 10.1.jar
- XWork的核心 - 2.1.6.jar
更新:我認爲公約-插件-JAR 2.3.14.3與其他2.5.10.1那些不兼容的,所以我下載: struts2-convention-plugin-2.5.10.1.jar
現在在啓動時得到
java.lang.IncompatibleClassChangeError: org/apache/struts2/convention/DefaultClassFinder$InfoBuildingVisitor
at org.apache.struts2.convention.DefaultClassFinder.readClassDef(DefaultClassFinder.java:459) ~[struts2-convention-plugin-2.5.10.1.jar:2.5.10.1]
at org.apache.struts2.convention.DefaultClassFinder.<init>(DefaultClassFinder.java:90) [struts2-convention-plugin-2.5.10.1.jar:2.5.10.1]
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildClassFinder(PackageBasedActionConfigBuilder.java:397) [struts2-convention-plugin-2.5.10.1.jar:2.5.10.1]
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:379) [struts2-convention-plugin-2.5.10.1.jar:2.5.10.1]
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:335) [struts2-convention-plugin-2.5.10.1.jar:2.5.10.1]
at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53) [struts2-convention-plugin-2.5.10.1.jar:2.5.10.1]
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:199) [struts2-core-2.5.10.1.jar:2.5.10.1]
對該溶液添加ASM 5.x的JAR文件它們是Struts的JAR公約註解的依賴。我們使用的是ASM 3.3。我添加了ASM-Core,-Common, - 版本5.1 JAR。
這是它,謝謝 –
它應該是評論。 –
這不提供問題的答案。要批評或要求作者澄清,請在其帖子下方留言。 - [來自評論](/ review/low-quality-posts/16729305) – TobiMcNamobi