I have an issue trying to use Load Time weaving with Spring.
With the addition of the weaving context:
*<context:load-time-weaver />*
I get this error when running :
*Caused by: 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
[sun.misc.Launcher$AppClassLoader] 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
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
*
I see some posts talk about the same issue with Jetty:
*http://forum.springsource.org/archive/index.php/t-58666.html
*
then a fix would be to add:
*When I start maven jetty:run with the following set:
set MAVEN_OPTS=-javaagent:"C:\Documents and
Settings\Administrator\.m2\repository\org\springfr
amework\spring-agent\2.5.4\spring-agent-2.5.4.jar"
*
But I tried that and it does not work.
I also have the dependency like this:
*<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-agent</artifactId>
<version>${spring.version}</version>
<scope>provided</scope>
</dependency>
*
Can anyone help me to get Maven to play well?
---
Thank You…
Mick Knutson, President
BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233
Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---