错误

来源:6-3 店铺信息编辑之Controller层实现

敏翰空

2022-03-21

图片描述javax.servlet.ServletException: Servlet.init() for servlet [spring-dispatcher] threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocolConnectionHandler.process(AbstractProtocol.java:810)org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:810) org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:810)org.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1498)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThreadWorker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)

Root Cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in file [F:\Tomcat\apache-tomcat-8.5.45\webapps\o2o\WEB-INF\classes\spring\spring-dao.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)

写回答

1回答

翔仔

2022-03-23

看起来是pom.xml里面存在mybatis和spring框架版本不兼容的问题?建议和课程版本保持一致

https://www.yunweiku.com/thread-306464-1-1.html


0
2
翔仔
回复
敏翰空
这个看起来还是版本不兼容的问题,同学直接复制粘贴最终源码里面的pom.xml试试? 此外,也可以按照这个https://blog.csdn.net/khxu666/article/details/79851070 搭建起来,先确保能访问到,然后再和视频一样编码也是可以的
2022-03-23
共2条回复

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

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

5113 学习 · 8144 问题

查看课程