Look at PersistenceUnitGBean to see how to do this in geronimo.

You need to define a gbean that will install the transformer into the geronimo transformer framework.  You need to set the priority of the gbean to PRIORITY_CLASSLOADING so it gets started before any application classes that you want to enhance are loaded.

thanks
david jencks

On Jul 7, 2010, at 8:18 AM, Jigar Shah wrote:

Hi, In my application, In our application, we are using AsjpectJ. When I had deployed application on Tomcat, it had given me error like below. Error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.weaving.AspectJWeavingEnabler#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loadTimeWeaver': Initialization of bean failed; nested exception is java.lang.IllegalStateException: ClassLoader [org.apache.catalina.loader.WebappClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:spring-agent.jar After that I have set JVM variable -javaagent as below -javaagent:"{user.home}\.m2\repository\org\springframework\spring-instrument\3.0.0.RELEASE\spring-instrument-3.0.0.RELEASE.jar" After setting above property, my problem was resolved. I am using IntellijIdea editor. But, Now when I deploy my application on Geronimo it is throwing below error. Error: ------ org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.weaving.AspectJWeavingEnabler#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loadTimeWeaver': Initialization of bean failed; nested exception is java.lang.IllegalStateException: ClassLoader [org.apache.geronimo.kernel.classloader.JarFileClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:spring-agent.jar Geronimo is on Linux machine. So, I am not getting how to resolve above issue. I am sure that I have to set -javaagent variable somewhere but I don't know where and how to configure it. Notes: 1. Editor I am using is IntellijIdea 2. I am using maven Please guide me regarding it. Please ask if you want more details. Thanks

View this message in context: Not able to configure spring-agent on Geronimo
Sent from the Development mailing list archive at Nabble.com.