验证码生成失败

来源:4-12 引入kaptcha实现验证码

weibo_RUES无需言_0

2018-11-09

严重: Allocate exception for servlet [Kaptcha]
java.lang.ClassNotFoundException: com.google.code.kaptcha.servlet.KaptchaServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1308)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1136)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:544)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:525)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:773)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocolConnectionHandler.process(AbstractProtocol.java:790)atorg.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:790)atorg.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1468)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutorWorker.run(UnknownSource)atorg.apache.tomcat.util.threads.TaskThreadWorker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThreadWorker.run(UnknownSource)atorg.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
图片描述

写回答

3回答

翔仔

2018-11-09

没懂,changeVerifyCode is not defined 

同学你common.js里面有

function changeVerifyCode(img) {

img.src = "../Kaptcha?" + Math.floor(Math.random() * 100);

}

这个function吗?

并且如果有,你是否清楚了浏览器缓存了呢

0
4
weibo_RUES无需言_0
回复
翔仔
好的,谢谢
2018-11-10
共4条回复

weibo_RUES无需言_0

提问者

2018-11-09

111
//img.mukewang.com/szimg/5be59d2100018b1219201080.jpg

0
0

weibo_RUES无需言_0

提问者

2018-11-09

可以生成验证码了,我什么都没改,也没重启tomcat.好奇怪

现在点击更换的时候浏览器上面报错:

shopoperation:141 Uncaught ReferenceError: changeVerifyCode is not defined
    at HTMLImageElement.onclick (shopoperation:141)
    at a.sendClick (sm.min.js:7)
    at a.onTouchEnd (sm.min.js:7)
    at HTMLBodyElement.<anonymous> (sm.min.js:7)

已经引入了common.js。。

0
0

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程