I am trying to start jetty with a JVM option “-javaagent:/home/spring-framework-3.0.5/org.springframework.instrument-3.0.5.RELEASE.jar”
/usr/java/default/bin/java -Dorg.gradle.appname=gradle -javaagent:/home/spring-framework-3.0.5/org.springframework.instrument-3.0.5.RELEASE.jar -classpath /home/gradle/gradle-1.0/lib/gradle-launcher-1.0.jar org.gradle.launcher.GradleMain startJetty
or by
export GRADLE_OPTS="-javaagent:/home/spring-framework-3.0.5/org.springframework.instrument-3.0.5.RELEASE.jar" gradle startJetty
I am getting the following exception
Caused by: java.lang.IllegalStateException: ClassLoader [org.mortbay.jetty.webapp.WebAppClassLoader] does NOT provide an ‘addTransformer(ClassFileTransformer)’ method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring’s agent: -javaagent:org.springframework.instrument.jar
at org.springframework.context.weaving.DefaultContextLoadTimeWeaver.setBeanClassLoader(DefaultContextLoadTimeWeaver.java:83)
at
…
this is my implementation for running jetty
apply plugin: ‘jetty’ task startJetty(type: jettyRunWar.getClass()) {
webApp = file(“myWar.war”)
httpPort = 8090 }
Any clue what can be wrong here?