升级到Struts 2.3.20和jCaptcha 1.0

时间:2015-02-07 05:45:49

标签: struts2 jcaptcha

该项目使用jCaptcha 1.0,从2.3.16升级到Struts 2.3.20后,应用程序无法启动。 我们的项目没有使用jCaptcha struts集成,所以我们没有和jCaptcha配置ins strust.xml或web.xml,例如我们在struts.xml中 NOT 下面的行

<plug-in className="com.octo.captcha.module.struts.CaptchaServicePlugin"/>

我认为某些插件管理机制已更改,因此struts 2.3.20尝试查找并启动此插件,而2.3.16则没有。

错误如下:

ERROR finder.ClassFinder             Unable to read class [com.octo.captcha.module.struts.image.RenderImageCaptchaAction]
Could not load org/apache/struts/action/Action.class - [unknown location]
    at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:723)
    at com.opensymphony.xwork2.util.finder.ClassFinder.access$400(ClassFinder.java:71)
    at com.opensymphony.xwork2.util.finder.ClassFinder$InfoBuildingClassVisitor.extractSuperInterfaces(ClassFinder.java:770)
    at com.opensymphony.xwork2.util.finder.ClassFinder$InfoBuildingClassVisitor.visit(ClassFinder.java:757)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:718)
    at com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:113)
    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:274)
ERROR finder.ClassFinder             Unable to read class [com.octo.captcha.module.struts.VerifyCaptchaChallengeAction]
Could not load org/apache/struts/action/Action.class - [unknown location]
    at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:723)
    at com.opensymphony.xwork2.util.finder.ClassFinder.access$400(ClassFinder.java:71)
    at com.opensymphony.xwork2.util.finder.ClassFinder$InfoBuildingClassVisitor.extractSuperInterfaces(ClassFinder.java:770)
    at com.opensymphony.xwork2.util.finder.ClassFinder$InfoBuildingClassVisitor.visit(ClassFinder.java:757)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:718)
    at com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:113)
    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:390)
    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:347)
ERROR finder.ClassFinder             Error loading class [com.octo.captcha.module.struts.CaptchaServicePlugin]
java.lang.NoClassDefFoundError: org/apache/struts/action/PlugIn
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    at com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate.loadClass(ClassLoaderInterfaceDelegate.java:34)
    at com.opensymphony.xwork2.util.finder.ClassFinder$ClassInfo.get(ClassFinder.java:563)
    at org.apache.struts2.convention.PackageBasedActionConfigBuilder$3.test(PackageBasedActionConfigBuilder.java:613)
    at org.apache.struts2.convention.PackageBasedActionConfigBuilder$3.test(PackageBasedActionConfigBuilder.java:600)
    at com.opensymphony.xwork2.util.finder.ClassFinder.findClasses(ClassFinder.java:343)
    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:393)
    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:274)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
Caused by: java.lang.ClassNotFoundException: org.apache.struts.action.PlugIn
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    ... 35 more
ERROR finder.ClassFinder             Error loading class [com.octo.captcha.module.struts.image.RenderImageCaptchaAction]
java.lang.NoClassDefFoundError: org/apache/struts/action/Action
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    at com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate.loadClass(ClassLoaderInterfaceDelegate.java:34)
    at com.opensymphony.xwork2.util.finder.ClassFinder$ClassInfo.get(ClassFinder.java:563)
    at com.opensymphony.xwork2.util.finder.ClassFinder.findClasses(ClassFinder.java:344)
    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:393)
    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:347)
Caused by: java.lang.ClassNotFoundException: org.apache.struts.action.Action
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    ... 33 more
ERROR finder.ClassFinder             Error loading class [com.octo.captcha.module.struts.VerifyCaptchaChallengeAction]
java.lang.NoClassDefFoundError: org/apache/struts/action/Action
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    at com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate.loadClass(ClassLoaderInterfaceDelegate.java:34)
    at com.opensymphony.xwork2.util.finder.ClassFinder$ClassInfo.get(ClassFinder.java:563)
    at com.opensymphony.xwork2.util.finder.ClassFinder.findClasses(ClassFinder.java:344)
    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:393)
    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:274)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
Caused by: java.lang.ClassNotFoundException: org.apache.struts.action.Action
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    ... 33 more
ERROR finder.ClassFinder             Error loading class [com.octo.captcha.module.struts.VerifyCaptchaChallengeMethodAction]
java.lang.NoClassDefFoundError: org/apache/struts/action/Action
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
Caused by: java.lang.ClassNotFoundException: org.apache.struts.action.Action
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    ... 40 more

0 个答案:

没有答案