将Struts 2.3迁移到2.5

时间:2018-02-26 04:23:35

标签: struts tiles

struts迁移时我遇到了一些问题, 我在我的申请中使用了瓷砖。下面是错误

SEVERE: Error deploying web application archive

java.lang.UnsupportedClassVersionError:org / apache / struts2 / tiles / StrutsTilesListener:不支持的major.minor版本51.0(无法加载类org.apache.struts2.tiles.StrutsTilesListener)     在org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2822)     在org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)     在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)     在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)     at org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebAnnotationSet.java:144)     at org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:73)     在org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:56)     在org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:353)     在org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:885)     在org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)     在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)     在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5081)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)     在org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)     在org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)     在org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)     在org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:932)     在org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:723)     在org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)     在org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)     在org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)     在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)     在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)     在org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:379)     在org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:324)     在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)     在org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)     在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)     在org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)     在org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)     在org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)     在org.apache.catalina.startup.Catalina.start(Catalina.java:620)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)     在java.lang.reflect.Method.invoke(Method.java:597)     在org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)     在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)

这是在web.xml中使用的过滤器

    Struts2的     org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter     

1 个答案:

答案 0 :(得分:0)

org.apache.struts2.tiles.StrutsTilesListener的版本是51.0,对应于Java SE 7.

您可以使用Java : Unsupported major.minor version 51.0解决方案来更新您的Java安装。