Trying to start Jetty with JVM option


(vipss78) #1

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?


(vipss78) #2

I also tried with setting default_JVM in gradlew file…


(vipss78) #3

Is there a way I can provide JVM option using the plugin… or Jetty config file?