Helper class issue on server startup
rachmato Aug 7, 2015 5:24 PMI have a byteman script which I want to run from startup in an application server. This byteman script makes use of a HelperClass.
I have modified the server startup to specify the javaagent as follows:
-Dorg.jboss.byteman.transform.all -javaagent:/opt/byteman-3.0.1/lib/byteman.jar=script:/home/nrla/java/byteman/jboss-ejb-client/jboss-ejb-client.btm,boot:/opt/byteman-3.0.1/lib/byteman.jar,boot:/home/nrla/ideaProjects/byteman-helper/target/EJBClientHelper-1.0-SNAPSHOT.jar,listener:true
As far as I can tell, this is a fairly conventional approach to loading a helper class at startup. Note that I have put the helper in the org.jboss.byteman package.
When the server starts, however, I see this:
16:24:10,005 INFO [stdout] (ServerService Thread Pool -- 31) Rule.execute called for ConfigBasedEJBClientContextSelector_init_7
16:24:10,014 INFO [stdout] (ServerService Thread Pool -- 31) Rule.ensureTypeCheckedCompiled : error compiling rule ConfigBasedEJBClientContextSelector_init
16:24:10,015 INFO [stdout] (ServerService Thread Pool -- 31) org.jboss.byteman.rule.exception.CompileException: Compiler.createHelperAdapter : exception creating interpreted helper adapter for org.jboss.byteman.EJBClientHelper
16:24:10,015 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.byteman.rule.compiler.Compiler.getHelperAdapter(Compiler.java:78)
16:24:10,015 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.byteman.rule.Rule.compile(Rule.java:545)
16:24:10,015 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.byteman.rule.Rule.ensureTypeCheckedCompiled(Rule.java:450)
16:24:10,015 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.byteman.rule.Rule.execute(Rule.java:672)
16:24:10,016 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.byteman.rule.Rule.execute(Rule.java:653)
16:24:10,016 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:53)
16:24:10,016 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:71)
16:24:10,016 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.ejb.client.EJBClientContext.<clinit>(EJBClientContext.java:78)
16:24:10,016 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.ejb3.remote.DefaultEjbClientContextService$SetSelectorAction.run(DefaultEjbClientContextService.java:144)
16:24:10,017 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.ejb3.remote.DefaultEjbClientContextService$SetSelectorAction.run(DefaultEjbClientContextService.java:134)
16:24:10,017 INFO [stdout] (ServerService Thread Pool -- 31) at java.security.AccessController.doPrivileged(Native Method)
16:24:10,017 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.ejb3.remote.DefaultEjbClientContextService.<clinit>(DefaultEjbClientContextService.java:68)
16:24:10,017 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.ejb3.subsystem.EJB3SubsystemAdd.addRemoteInvocationServices(EJB3SubsystemAdd.java:392)
16:24:10,017 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.ejb3.subsystem.EJB3SubsystemAdd.performBoottime(EJB3SubsystemAdd.java:344)
16:24:10,018 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.controller.AbstractBoottimeAddStepHandler.performRuntime(AbstractBoottimeAddStepHandler.java:69)
16:24:10,018 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:75)
16:24:10,018 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:591)
16:24:10,018 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:469)
16:24:10,018 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:273)
16:24:10,019 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:268)
16:24:10,019 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:343)
16:24:10,019 INFO [stdout] (ServerService Thread Pool -- 31) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
16:24:10,019 INFO [stdout] (ServerService Thread Pool -- 31) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
16:24:10,020 INFO [stdout] (ServerService Thread Pool -- 31) at java.lang.Thread.run(Thread.java:744)
16:24:10,020 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.threads.JBossThread.run(JBossThread.java:122)
16:24:10,020 INFO [stdout] (ServerService Thread Pool -- 31) Caused by: java.lang.IllegalAccessError: class org.jboss.byteman.EJBClientHelper_HelperAdapter_Interpreted_1 cannot access its superclass org.jboss.byteman.EJBClientHelper
16:24:10,020 INFO [stdout] (ServerService Thread Pool -- 31) at java.lang.ClassLoader.defineClass1(Native Method)
16:24:10,020 INFO [stdout] (ServerService Thread Pool -- 31) at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
16:24:10,021 INFO [stdout] (ServerService Thread Pool -- 31) at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
16:24:10,021 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.byteman.rule.compiler.Compiler$ClassbyteClassLoader.addClass(Compiler.java:530)
16:24:10,021 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.byteman.rule.compiler.Compiler.loadHelperAdapter(Compiler.java:555)
16:24:10,021 INFO [stdout] (ServerService Thread Pool -- 31) at org.jboss.byteman.rule.compiler.Compiler.getHelperAdapter(Compiler.java:71)
16:24:10,021 INFO [stdout] (ServerService Thread Pool -- 31) ... 24 more
16:24:10,022 INFO [stdout] (ServerService Thread Pool -- 31)
I have tried loading this helper jar via boot: as well as sys: and I get the same error.
From looking at blog examples, I know this should not be happening.
Any ideas?
BTW, I did have this same problem on the client side, when configuring the javaagent for the client and trying tp specify the helper there, and it "disappeared" when I added the helper jar to the application client startup classpath (via a maven depenedency).
Richard