明天进步一点点 2021-10-29 16:09 采纳率: 33.3%
浏览 52

springmvc找不到controller实现类,使用继承controller接口而非注解实现

tomcat启动报错找不到controller实现类,jdk版本17,tomcat9,springmvc5.注解可正常运行

img

img


1.9
问题如下
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping#0' defined in class path resource [springmvc.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [controller.ControllerTest1] for bean with name '/t1' defined in class path resource [springmvc.xml]; nested exception is java.lang.ClassNotFoundException: controller.ControllerTest1
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [controller.ControllerTest1] for bean with name '/t1' defined in class path resource [springmvc.xml]; nested exception is java.lang.ClassNotFoundException: controller.ControllerTest1
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:701)
at

  • 写回答

1条回答 默认 最新

  • 编号灬9527 2021-10-29 16:13
    关注

    ClassNotFoundException: controller.ControllerTest1

    评论

报告相同问题?

问题事件

  • 修改了问题 10月29日
  • 创建了问题 10月29日

悬赏问题

  • ¥15 Coze智能助手搭建过程中的问题请教
  • ¥15 12864只亮屏 不显示汉字
  • ¥20 三极管1000倍放大电路
  • ¥15 vscode报错如何解决
  • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
  • ¥15 python随机森林对两个excel表格读取,shap报错
  • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
  • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。
  • ¥30 求给定范围的全体素数p的(p-2)/p的连乘积值
  • ¥15 VFP如何使用阿里TTS实现文字转语音?