在junit中测试正常通过,然后本人在
Spring3.0.4下测试,缺报错,信息如下:
2010-12-24 16:10:08 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@c2ea3f: startup date [Fri Dec 24 16:10:08 CST 2010]; root of context hierarchy
2010-12-24 16:10:08 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [beans.xml]
2010-12-24 16:10:08 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@513cf0: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,userDao,userService,loginInterceptor,org.springframework.aop.config.internalAutoProxyCreator]; root of factory hierarchy
要
使aspectj正常工作,还需要几个其他的包,依次如下:
aspectjrt.jar
aspectjweaver.jar
aoplliance-1.0.jar
org.springframework.asm-3.0.2.RELEASE.jar
asm-all-3.2.jar
cglib-nodep-2.1.3.jar
Spring中的相关包:
commons-logging-1.1.1.jar
org.springframework.beans-3.0.4.REALEASE.jar
org.springframework.context-3.0.4.RELEASE.jar
org.springframework.context-support-3.0.4.RELEASE.jar
org.springframework.core-3.0.4-RELEASE.jar
org.springframework.expression-3.0.4-RELEASE.jar
org.springframework.aspects-3.0.4-RELEASE.jar
org.springframework.aop-3.0.4-RELEASE.jar
测试开始……
******************************************************
第一轮测试,Junit测试未通过,显示缺少jar包,尽管没通过,至少是给了提示,
如下:
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name
'org.springframework.aop.config.internalAutoProxyCreator ': Instantiation
of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class
[org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoPr
oxyCreator]: Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError:
org/aopalliance/intercept/MethodInterceptor
at
........
第一行得知,缺少aoplliance.jar 导入,再测……
******************************************************************
提示缺少xerces.jar 转机出现在这里,在寻找xerces.jar的时候,看到一篇帖子
,上面大致意思是说,尽量使用Spring本身提供的jar包,这样可以减少bao这件的
排斥性,即不兼容,想了想,也是,找到xerces.jar 导入,再测……
******************************************************************
未果……错误代码没有找到有用信息。
看来aspectjtools包并没有起作用!
这时候想起了刚才看到的建议,然后又进jar库,无意间发现了一个
org.aspectj.aspectjweaver_1.5.3.jar的包,随便把它加了进去,导入
项目,测试开始……
*********************************************************************
Junit测试进度条显示绿色,测试通过,逻辑被调用,切入面工作正常……
日志输出如下:
2010-11-3 17:33:24
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
信息: Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@182f0
db: startup date [Wed Nov 03 17:33:24 CST 2010]; root of context
hierarchy
2010-11-3 17:33:24
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [beans.xml]
2010-11-3 17:33:25
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
信息: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1df
280b: defining beans
[org.springframework.context.annotation.internalConfigurationAnnotationP
rocessor,org.springframework.context.annotation.internalAutowiredAnnotat
ionProcessor,org.springframework.context.annotation.internalRequiredAnno
tationProcessor,org.springframework.context.annotation.internalCommonAnn
otationProcessor,logInterceptor,userDAOImpl,userService,org.springframew
ork.aop.config.internalAutoProxyCreator]; root of factory hierarchy
before method...Avin hello!
user saved!--This is DAOImpl1
**************************************************************
最后两行的为具体的输出信息,最后一行是目标函数的输出信息,倒数第二行是切
面中的逻辑! 幸运落在了最后的jar包上:org.aspectj.aspectjweaver.jar
经几天测试得到的正确匹配Jar包列表如下:
org.springframework.beans-3.0.4.REALEASE.jar
org.springframework.context-3.0.4.RELEASE.jar
org.springframework.context-support-3.0.4.RELEASE.jar
org.springframework.core-3.0.4-RELEASE.jar
org.springframework.expression-3.0.4-RELEASE.jar
org.springframework.aspects-3.0.4-RELEASE.jar
org.springframework.aop-3.0.4-RELEASE.jar
commons-logging-1.1.1.jar
junit-4.9-SNAPSHOT-20100512-0041.jar
aspectjrt-111.jar
asm-all-3.2.jar
cglib-nodep-2.1.3.jar
aoplliance-1.0.jar
org.springframework.asm-3.0.2.RELEASE.jar
org.aspectj.aspectjweaver_1.5.3.jar
测试至此结束,问题解决……
希望能给遇到此问题的人一些思路……
***************************************
总结:
1.j2ee中很多框架之间存在着错综复杂的jar包依赖关系(估计可以和
linux里边的rpm依赖媲美了……解决依赖关系的方法大多是寻找正确匹配的jar包
,这里向大家提供跟两个jar包的下载网站:
http://www.java2s.com/
http://www.findjar.com/jar/cglib/cglib-nodep/2.1_3/cglib-nodep-
2.1_3.jar.html
2.CSDN很优秀,很多技术性的文章写得很有针对性!学习交流的好地方!
3.Google资料相较于Baidu多很多,尤其是外国技术资料!
4.遇到报错时,冷静分析,找到可能的切入点,保持冷静,清醒!
5.当确定方向正确时,坚持下去!
6.记住,豆芽长一房高,也是根菜!我们要鄙视敌人! 呵呵!
好,关于这个问题就写这么多,希望
对大家有帮助……
同时也期待各位的相互交流指点……
本人在此祝大家平安夜和圣诞节快乐!!!!
- 大小: 6.6 KB
分享到:
相关推荐
Spring 3.0.4 手册 CHM版
org.springframework.aop-3.0.4.RELEASE.jar org.springframework.asm-3.0.4.RELEASE.jar org.springframework.aspects-3.0.4.RELEASE.jar org.springframework.beans-3.0.4.RELEASE.jar org.springframework....
spring 3.0.4 源码 类文件打成jar包,可以直接丢到项目中
Spring3.0.4所需的全部jar包,亲测可用,省去大家下载的时间。
这是一个学习Spring3.0.4的学习手册
spring security3.0.4 的acl使用例子,相关的说明在 http://blog.csdn.net/lhx1026/archive/2010/11/22/6027125.aspx
spring3.0.4说明,详细介绍了spring3.0.4的特性
J2EE框架之一的Sping的Framework包,最新版。 里面还包括官方文档。 由于大小限制,不得不将它分为3部分了。
spring 3.0.4+mybatis 3.2.3 在学习myBatis和spring整合的情况下,需要下载对应的jar包,如果不方便在网上到处收集,可以直接通过下载这个zip包,解决就可以得到整合需要用到的包。方便,快捷。
完整的3.0.4.RELEASE,dist目录下有所有jar包,docs目录下是javadoc-api(英文原版)和关于spring的规范,projects下则是源代码。 Spring-Reference_zh_CN.rar则来自于CSDN,一份中文版的指导。 出于共享的目的,本...
赠送jar包:jasypt-spring-boot-3.0.4.jar; 赠送原API文档:jasypt-spring-boot-3.0.4-javadoc.jar; 赠送源代码:jasypt-spring-boot-3.0.4-sources.jar; 赠送Maven依赖信息文件:jasypt-spring-boot-3.0.4.pom;...
赠送jar包:jasypt-spring-boot-3.0.4.jar; 赠送原API文档:jasypt-spring-boot-3.0.4-javadoc.jar; 赠送源代码:jasypt-spring-boot-3.0.4-sources.jar; 赠送Maven依赖信息文件:jasypt-spring-boot-3.0.4.pom;...
赠送jar包:spring-cloud-context-3.0.4.jar; 赠送原API文档:spring-cloud-context-3.0.4-javadoc.jar; 赠送源代码:spring-cloud-context-3.0.4-sources.jar; 赠送Maven依赖信息文件:spring-cloud-context-...
Jbpm4.4+hibernate3.5.4+spring3.0.4+struts2.1.8整合 超级详细的文档,透彻讲解JBPM与SSH的整合过程
赠送jar包:spring-cloud-gateway-server-3.0.4.jar; 赠送原API文档:spring-cloud-gateway-server-3.0.4-javadoc.jar; 赠送源代码:spring-cloud-gateway-server-3.0.4-sources.jar; 赠送Maven依赖信息文件:...
SSH框架Jar包介绍 spring3.0.4+hibernate3.5.5+struts2.2.1
整合struts2.2.1+spring3.0.4+hibernate3.6选择jar包. 不需要的包不要,这样可以使工程不会很庞大。
struts2.2.1 + hibernate3.6 +spring3.0.4 整合例子
spring3.0.4 struts2.1.8 hibernate3.5.5 整合 所需要的jar文件(2) 由于文件稍大 给你第一个文件的链接 http://download.csdn.net/source/2647320
spring3.0.4 struts2.1.8 hibernate3.5.5 整合 所需要的jar文件(1) 导入就能是使用了 不会有冲突. 前提是你的配置文件正确 由于文件太大 给你第二个文件的链接http://download.csdn.net/source/2647325