ssh整合,导入structs包后报错 getAnnotation(AnnotatedElement ae,Class<T> annotatetype)找不到
今天在整合ssh(spring-framework-3.2.5.RELEASE-dist+struts-2.3.15.3-all+hibernate-release-4.2.6.Final)环境的时候,集成了hibernate和spring,经过单元测试,没有问题,集成成功。但是在导入structs包后,项目报错,具体错误如下:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [bean.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [bean.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.getAnnotation(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
找不到 getAnnotation(AnnotatedElement ae,Class<T> annotatetype)这样的方法,于是我查找了项目中使用spring版本的文档,发现下面这个方法:
public static <T extends Annotation> T getAnnotation(AnnotatedElement ae,
Class<T> annotationType)
Get a single Annotation of annotationType from the supplied Method, Constructor or Field. Meta-annotations will be searched if the annotation is not declared locally on the supplied element.
Parameters:
ae - the Method, Constructor or Field from which to get the annotation
annotationType - the annotation class to look for, both locally and as a meta-annotation
Returns:
the matching annotation or null if not found
Since:
3.1
文档中显示,3.1以后版本才有这个方法,这是就猜想项目中是不是有3.1一下版本的spring核心包,经过查找,在struts-2.3.15.3这个版本中包含了spring-core-3.0.5.RELEASE.jar这样一个jar包,低于3.1版本。
在项目中删除spring-core-3.0.5.RELEASE.jar这个jar,问题就解决了
另外:使用struts-2.3.15.3 需要注意,此版本中包含了包含里除了spring-core-3.0.5.RELEASE.jar以外的spring需要3.0.5版本的jar包,在使用的时候都需要删除
ssh整合,导入structs包后报错 getAnnotation(AnnotatedElement ae,Class<T> annotatetype)找不到的更多相关文章
- PyCharm导入tensorflow包报错的问题
[注]PyCharm导入tensorflow包报错的问题 若是你也遇到这个问题,说明你也没有理解tensorflow到底在哪里. 当安装了anaconda3.6后,在PyCharm中设置interpr ...
- Android Studio项目导入aar包报错
最近在试着接入TrPay的sdk,根据它家文档需要导入它们的aar包(paysdk-release-1.2.2.aar). 在AS中怎么给安卓项目导入aar包,网上搜一下就能看到无非也就下面三步: 1 ...
- paycharm导入webdriver包报错:module 'selenium.webdriver' has no attribute 'Firefox'
首先:试试看在cmd中试试输入from selenium import webdriver,看是否报错,看一看是不是pycharm的原因.经过确认,在dos窗口中输入导入包的命令并没有报错.最后我重现 ...
- eclipse导入项目之后报错
一.项目本身就有错 二.jdk版本的问题 参考网址:http://jingyan.baidu.com/article/95c9d20da3ec5fec4e756186.html 从别的地方导入一个项目 ...
- Android源代码编译apk导入第三方包报错
报错内容例如以下: make: *** 没有规则能够创建"out/target/common/obj/APPS/ AndroidWFS_intermediates/classes-full- ...
- ssh整合思想 Spring与Hibernate的整合ssh整合相关JAR包下载 .MySQLDialect方言解决无法服务器启动自动update创建表问题
除之前的Spring相关包,还有structs2包外,还需要Hibernate的相关包 首先,Spring整合其他持久化层框架的JAR包 spring-orm-4.2.4.RELEASE.jar ( ...
- IDEA 导入 Maven 项目后报错 cannot resolve symbol 解决办法
这两天整理项目,导入新的 Maven 项目时出现 cannot resolve symbol ,即使 rebuild 也没有用.解决办法如下: 1. File -> Close Project: ...
- SSH整合后tomcat启动报错SEVERE: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
错误信息: SEVERE: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/objectweb/asm/C ...
- Vite + TS 项目导入 jQuery 包时报错:Could not find a declaration file
TypeScript 需要类型标注,当使用第三方库(除 ts 以外写的库,即 js)时,又缺少声明文件,我们需要引用它的声明文件,才能获得对应的代码补全.接口提示等功能.jQuery 不是 TypeS ...
随机推荐
- AIX 环境下动态路由
IBM AIX v5.3操作系统环境下动态路由配置如下: 1,用命令lssrc -S routed和lssrc -S gated分别检查routed和gated子系统是是活动状态.如果这两个子系统为活 ...
- poj1068
Parencodings Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18785 Accepted: 11320 De ...
- http://www.cnblogs.com/youring2/archive/2011/03/28/1997694.html
http://www.cnblogs.com/youring2/archive/2011/03/28/1997694.html
- Arcgis Server发布服务
提到Arcgis Server 服务的发布,做起来貌似很简单,就算电脑再卡,只要鼠标还能点,一个小时肯定能搞定,但是当你遇到问题的时候,就头大了,也许搞上个一两天都摸不着头脑,最后你采取的措施可能是一 ...
- python之路-Day4
本节内容 1. 函数基本语法及特性 2. 参数与局部变量 3. 返回值 嵌套函数 4.递归 5.匿名函数 6.函数式编程介绍 7.高阶函数 8.内置函数 函数是什么? 函数一词来源于数学,但编程中的「 ...
- U-Mail邮件网关提醒:谨防像素图片钓鱼窃密
垃圾邮件和病毒的日益猖獗,既因为邮件在商务往来中扮演着越来越重要的角色,也因为犯罪成本低收益高.近年来,不少为非作歹者致力于通过邮件诈骗牟利,想出了种种奇思妙计,导致相关服务商在安全领域逐年加大研发投 ...
- plsql很好用的自定义设置【转载】
本文是转载的,目的是方便自已随时可以查看.转载地址:http://blog.itpub.net/24496241/viewspace-740917/ 目的:方便自已随时可以查看 1.格式化SQL语句在 ...
- mac上执行sed的编辑 -i命令报错sed: 1: "test.txt": undefined label ‘est.txt’或sed: 1: "2a\test\": extra characters after \ at the end of a command
问题一 sed编辑命令:[sed -i 's/a/b/g' test.txt] 报错:sed: 1: "test.txt": undefined label 'est.txt' ...
- Android Studio使用百度地图示例BaiduMapsApiASDemo
Android Studio使用百度地图示例BaiduMapsApiASDemo 用自己AVD下的debug.keystore替换掉项目中的debug.keystore 生成自己的签名 同样的方法生成 ...
- Palindrome Pairs
Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that t ...