struts2.1.6使用中出现的一点小问题
程序员文章站
2022-07-10 20:27:38
...
最近开始学习struts2,使用2.1.6版本。方法是阅读项目的源码,之前有学习过webwork所以还好上手整合S2SH,启动tomcat报出异常如下
网上也有很多人出现这个问题,搜索了下没有好的解决办法,想了下可能引入struts-default的原因,
于是将struts-default.xml导入到classpath下所有问题都解决了,
在struts2.1.6中已经找不到struts-default.xml 还有*.tld 不知道什么原因,网上有人说是从2.0.8版本后需要maven源文件包才能发现,本人是新手maven不了解。
问题是解决了,不过原因还不清楚,如果谁了解的话,请留言谢谢
严重: Exception starting filter struts2
java.lang.RuntimeException: java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.util.reflection.ReflectionProvider, name='default'] in public void com.opensymphony.xwork2.ObjectFactory.setReflectionProvider(com.opensymphony.xwork2.util.reflection.ReflectionProvider).
at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)
at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:517)
at com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:548)
at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:546)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:182)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:403)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:453)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.util.reflection.ReflectionProvider, name='default'] in public void com.opensymphony.xwork2.ObjectFactory.setReflectionProvider(com.opensymphony.xwork2.util.reflection.ReflectionProvider).
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
... 29 more
Caused by: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.util.reflection.ReflectionProvider, name='default'] in public void com.opensymphony.xwork2.ObjectFactory.setReflectionProvider(com.opensymphony.xwork2.util.reflection.ReflectionProvider).
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:144)
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods(ContainerImpl.java:113)
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:90)
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:86)
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:86)
at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:71)
at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:69)
at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.<init>(ContainerImpl.java:348)
at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:305)
at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:304)
at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
at com.opensymphony.xwork2.inject.ContainerImpl.getConstructor(ContainerImpl.java:594)
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:491)
... 34 more
Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.util.reflection.ReflectionProvider, name='default'] in public void com.opensymphony.xwork2.ObjectFactory.setReflectionProvider(com.opensymphony.xwork2.util.reflection.ReflectionProvider).
at com.opensymphony.xwork2.inject.ContainerImpl.createParameterInjector(ContainerImpl.java:235)
at com.opensymphony.xwork2.inject.ContainerImpl.getParametersInjectors(ContainerImpl.java:225)
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.<init>(ContainerImpl.java:287)
at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:117)
at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:115)
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:141)
... 55 more
网上也有很多人出现这个问题,搜索了下没有好的解决办法,想了下可能引入struts-default的原因,
于是将struts-default.xml导入到classpath下所有问题都解决了,
在struts2.1.6中已经找不到struts-default.xml 还有*.tld 不知道什么原因,网上有人说是从2.0.8版本后需要maven源文件包才能发现,本人是新手maven不了解。
问题是解决了,不过原因还不清楚,如果谁了解的话,请留言谢谢
上一篇: centos suricata 安装
下一篇: alphapose中出现的问题
推荐阅读
-
Word2003希望使用智能标记,但不希望紫色的虚线下划线出现在文档中。
-
【转载】C#中List集合使用IndexOf判断元素第一次出现的索引位置
-
【转载】C#中List集合使用LastIndexOf判断元素最后一次出现的索引位置
-
解析使用substr截取UTF-8中文字符串出现乱码的问题
-
使用hive过程中遇到的小问题
-
Mysql数据库中的 Order by 语句的特殊之处(select 中的项目不必出现在order by中)---不建议使用!
-
解决Vue2.0中使用less给元素添加背景图片出现的问题
-
使用加载图片解决在Ajax数据加载中页面出现短暂空白的问题(推荐)
-
pyqt5中QThread在使用时出现重复emit的实例
-
struts2.1.6使用中出现的一点小问题