sbt-aspectJ with Play org.aspectj.bridge.AbortException: ReflectionFactory unable to load org.aspectj.ajdt.ajc.AjdtCommand as org.aspectj.bridge.ICommand #42
I am trying to use aspectJ within a play app. After lot of digging around I am able to configure the aspectJ where I can see my java classes being weaved. But I am getting a runtime exception as soon as I am trying to hit the Play service
[Weaving 1 input to D:\Rogers\source\dpt-play-profile-service\target\scala-2.12\aspectj\classes...←[
[error] org.aspectj.bridge.AbortException: ReflectionFactory unable to load org.aspectj.ajdt.ajc.AjdtCommand as org.aspectj.bridge.ICommand
[error] at co.lightbend.sbt.SbtAspectj$Ajc$$anon$1.handleessage(SbtAspectj.scala:21)
[error] at org.aspectj.bridge.essageHandler.handleessage(essageHandler.java:15)
[error] at org.aspectj.bridge.ReflectionFactory.ake(ReflectionFactory.java:78)
[error] at org.aspectj.bridge.ReflectionFactory.akeCoand(ReflectionFactory.java:36)
[error] at org.aspectj.tools.ajc.ain.run(ain.java:364)
[error] at org.aspectj.tools.ajc.ain.runain(ain.java:248)
[error] at co.lightbend.sbt.SbtAspectj$Ajc$.runAjcain(SbtAspectj.scala:211)
[error] at co.lightbend.sbt.SbtAspectj$Ajc$.runAjc(SbtAspectj.scala:124)
[error] at co.lightbend.sbt.SbtAspectj$Ajc$.$anonfun$ajcTask$2(SbtAspectj.scala:111)
[error] at sbt.util.FileFunction$.$anonfun$cached$1(FileFunction.scala:73)
[error] at sbt.util.FileFunction$.$anonfun$cached$4(FileFunction.scala:147)
[error] at sbt.util.Difference.apply(Tracked.scala:3)
[error] at sbt.util.Difference.apply(Tracked.scala:293)
[error] at sbt.util.FileFunction$.$anonfun$cached$3(FileFunction.scala:143)
[error] at sbt.util.Difference.apply(Tracked.scala:3)
[error] at sbt.util.Difference.apply(Tracked.scala:288)
[error] at sbt.util.FileFunction$.$anonfun$cached$2(FileFunction.scala:142)
[error] at co.lightbend.sbt.SbtAspectj$Ajc$.$anonfun$ajcTask$1(SbtAspectj.scala:116)
[error] at scala.Function1.$anonfun$copose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] at sbt.std.Transfor$$anon$4.work(Syste.scala:66)
[error] at sbt.Execute.$anonfun$subit$2(Execute.scala:262)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:271)
[error] at sbt.Execute.$anonfun$subit$1(Execute.scala:262)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$subitValid$1(ConcurrentRestrictions.scala:174)
[error] at sbt.CopletionService$$anon$2.call(CopletionService.scala:36)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[error] at java.lang.Thread.run(Unknown Source)
below is what I am using as settings in the build.sbt
.settings(aspectjSettings,
AspectjKeys.aspectjVerbose := true,
AspectjKeys.aspectjShowWeaveInfo := true,
AspectjKeys.aspectjVersion := "1.8.5",
aspectjInputs in Aspectj += (aspectjCompiledClasses in Aspectj).value,
products in Compile := (products in Aspectj).value
products in Runtime := (products in Compile).value
)
javaAgents += "org.aspectj" % "aspectjweaver" % "1.8.5" % "compile;test"
javaOptions in run ++= (AspectjKeys.aspectjWeaverOptions in Aspectj).value
I am trying to use aspectJ within a play app. After lot of digging around I am able to configure the aspectJ where I can see my java classes being weaved. But I am getting a runtime exception as soon as I am trying to hit the Play service
[Weaving 1 input to D:\Rogers\source\dpt-play-profile-service\target\scala-2.12\aspectj\classes...←[ [error] org.aspectj.bridge.AbortException: ReflectionFactory unable to load org.aspectj.ajdt.ajc.AjdtCommand as org.aspectj.bridge.ICommand [error] at co.lightbend.sbt.SbtAspectj$Ajc$$anon$1.handleessage(SbtAspectj.scala:21) [error] at org.aspectj.bridge.essageHandler.handleessage(essageHandler.java:15) [error] at org.aspectj.bridge.ReflectionFactory.ake(ReflectionFactory.java:78) [error] at org.aspectj.bridge.ReflectionFactory.akeCoand(ReflectionFactory.java:36) [error] at org.aspectj.tools.ajc.ain.run(ain.java:364) [error] at org.aspectj.tools.ajc.ain.runain(ain.java:248) [error] at co.lightbend.sbt.SbtAspectj$Ajc$.runAjcain(SbtAspectj.scala:211) [error] at co.lightbend.sbt.SbtAspectj$Ajc$.runAjc(SbtAspectj.scala:124) [error] at co.lightbend.sbt.SbtAspectj$Ajc$.$anonfun$ajcTask$2(SbtAspectj.scala:111) [error] at sbt.util.FileFunction$.$anonfun$cached$1(FileFunction.scala:73) [error] at sbt.util.FileFunction$.$anonfun$cached$4(FileFunction.scala:147) [error] at sbt.util.Difference.apply(Tracked.scala:3) [error] at sbt.util.Difference.apply(Tracked.scala:293) [error] at sbt.util.FileFunction$.$anonfun$cached$3(FileFunction.scala:143) [error] at sbt.util.Difference.apply(Tracked.scala:3) [error] at sbt.util.Difference.apply(Tracked.scala:288) [error] at sbt.util.FileFunction$.$anonfun$cached$2(FileFunction.scala:142) [error] at co.lightbend.sbt.SbtAspectj$Ajc$.$anonfun$ajcTask$1(SbtAspectj.scala:116) [error] at scala.Function1.$anonfun$copose$1(Function1.scala:44) [error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39) [error] at sbt.std.Transfor$$anon$4.work(Syste.scala:66) [error] at sbt.Execute.$anonfun$subit$2(Execute.scala:262) [error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16) [error] at sbt.Execute.work(Execute.scala:271) [error] at sbt.Execute.$anonfun$subit$1(Execute.scala:262) [error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$subitValid$1(ConcurrentRestrictions.scala:174) [error] at sbt.CopletionService$$anon$2.call(CopletionService.scala:36) [error] at java.util.concurrent.FutureTask.run(Unknown Source) [error] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [error] at java.util.concurrent.FutureTask.run(Unknown Source) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [error] at java.lang.Thread.run(Unknown Source)
below is what I am using as settings in the build.sbt
.settings(aspectjSettings, AspectjKeys.aspectjVerbose := true, AspectjKeys.aspectjShowWeaveInfo := true, AspectjKeys.aspectjVersion := "1.8.5", aspectjInputs in Aspectj += (aspectjCompiledClasses in Aspectj).value, products in Compile := (products in Aspectj).value products in Runtime := (products in Compile).value ) javaAgents += "org.aspectj" % "aspectjweaver" % "1.8.5" % "compile;test" javaOptions in run ++= (AspectjKeys.aspectjWeaverOptions in Aspectj).value