spring mvc-springmvc 和velocity 配置 报错 VelocityEngineFactory NoClassDefFoundError

问题描述

springmvc 和velocity 配置 报错 VelocityEngineFactory NoClassDefFoundError

spring 4.1.6.RELEASE maven方式.
报错如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.geekworld.service.AccountService org.geekworld.controller.AccountController.accountService; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.web.servlet.view.velocity.VelocityConfigurer] for bean with name 'velocityConfig' defined in class path resource [spring-servlet.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/ui/velocity/VelocityEngineFactory
配置为

<!-- 使用springMacro的对象 -->

<!-- spring的日期格式化 -->

<!-- velocity toolbox -->

时间: 2024-09-08 11:42:32

spring mvc-springmvc 和velocity 配置 报错 VelocityEngineFactory NoClassDefFoundError的相关文章

Spring MVC实现上传文件报错解决方案

报错代码: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class is an interface org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:101) o

springMVC配置报错,求大神帮忙

问题描述 springMVC配置报错,求大神帮忙 解决方案 解决方案二: 解决方案三: 解决方案四: 解决方案五: No mapping found for HTTP request with URI [/demo/index.html] in DispatcherServlet with name 'spring' 说的很明白了 解决方案六: 建立也demo文件夹,把index.html挪进去. 解决方案七: RequestMapping("/demo/*")试试

maven问题,在pom.xml配置ssh时spring有两个依赖包报错

问题描述 maven问题,在pom.xml配置ssh时spring有两个依赖包报错 //一条红线划着<>org.springframeworkspring-orm3.1.1.RELEASE <dependency>//一条红线划着<<dependency>> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> &l

spring.net 泛型配置报错问题

问题描述 spring.net 泛型配置报错问题 我在一个类里定义了两个泛型对角如下: public class UserController : Controller { // // GET: /User/ BaseService<MDL.User_Test_T> user_test_t { set; get; } BaseService<MDL.Role_Info_T> role_info_t { set; get; } } xml 配置如下: <object type=

spring-使用SpringMVC 静态资源访问 报错ConversionFailedException

问题描述 使用SpringMVC 静态资源访问 报错ConversionFailedException 使用的spring 版本是 4.20 在springmvc配置 报错很奇怪.. 解决方案 该错误是因为: 1.内嵌jetty在运行时会锁定静态资源:因此在运行过程中不能删除静态资源: 2.问题的根源是启动了多个jetty实例,但是实际没有报端口冲突,可以检查任务管理器看是否有多个java/javaw进程在运行,如果是杀掉进程然后重试. 解决方案二: 配置这个没? <mvc:resources

IDEA开发JavaWeb(SpringMVC+MyBatis)项目报错。

问题描述 IDEA开发JavaWeb(SpringMVC+MyBatis)项目报错. 刚开始JavaWeb的开发,用了SpringMVC+Mybatis的结构,按着教程来的,但是运行欢迎页能看到,但是报了Injection of resource dependencies failed.错误,Dao没找到.这是工程的结构.这是applicationContext.xml的配置. <?xml version=""1.0"" encoding="&quo

spring和mybatis集成时总报错 麻烦帮忙看下什么原因

问题描述 spring和mybatis集成时总报错 麻烦帮忙看下什么原因 项目请求数据的时候报Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.business.dao.system.AdminMapper.selectByPrimaryKey麻烦大神帮忙看下这是啥原因,找了好久不知道

update无效-mybatis+spring+strust2 后update操作不报错但没起效果

问题描述 mybatis+spring+strust2 后update操作不报错但没起效果 日志如上图 sql语句文件如上图 有两个疑问: 1 做insert操作无任何问题,update 操作不报错,就是更新无效果,数据还是原来的数据. 2 sql语句的配置xml文件中判断了if xxx!=null 但是日志里打印出来的sql还是有null (如图2) 解决方案 你的if条件有问题,如果你的参数里面已经有title等参数,就应该写为title!=null而不是带#的 解决方案二: http://

spring-注解扫描和mvc注解扫描放一起报错!

问题描述 注解扫描和mvc注解扫描放一起报错! Spring AOP前置通知案例 这两个注解开启注解扫描 不开启mvc注解一切正常 controller层能正确显示页面 测试方法也能正确测试出aop通知成功!但是开启mvc注解后controller层能正常显示 测试AOP前置通知的方法会报错是为什么? <!-- 开启注解扫描 --> <context:component-scan base-package="com" /> <!-- mvc注解扫描支持@R