Hi Everyone,

We are using Spring 2.5.5 and aspect weaver jar version 1.5.4 in our web application, which runs on Websphere 6.1 server in Linux environment.

We are using a profiling tool in one of our performance test environments.
Apparently , there is some issue with the way Spring uses aspectJ ,in an environment which is profiled by a tool.
The tool basically injects some byte codes , at the start up of the JVM, in order to profile the incoming requests in the application.

The issue is that when the application starts in the tool enabled environment, the Spring fails to initialize certain beans, and throws the following exception :

Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jdbcTemplate' defined in ServletContext resource [/WEB-INF/config/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Access Controller.java:219)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:221)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:269)
... 99 more
Caused by: java.lang.NullPointerException
at org.aspectj.weaver.reflect.Java15AnnotationFinder. getAnnotations(Java15Annotation
Finder.java:108)
at org.aspectj.weaver.reflect.ReflectionBasedResolved MemberImpl.unpackAnnotations(ReflectionBasedResolv edMemberImpl.java:174)
at org.aspectj.weaver.reflect.ReflectionBasedResolved MemberImpl.hasAnnotation(ReflectionBasedResolvedMe mberImpl.java:158)
at org.aspectj.weaver.patterns.ExactAnnotationTypePat tern.matches(ExactAnnotationTypePattern.java:82)
at org.aspectj.weaver.patterns.AnnotationPointcut.mat chInternal(AnnotationPointcut.java:151)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcu t.java:146)


When we turn off the profiling tool, the application starts and works just fine.

Any help would be highly appreciated in this matter.

Thanks,
Nitin.