2 Replies Latest reply on Oct 11, 2015 1:33 PM by Radek Koubský

    No matching injection point for method ...

    Radek Koubský Newbie

      Hi,

      I am continuing in discussion about problems in try - catch - finally block, see Unexpected behavior in TRY-CATCH-FINALLY

       

      I have another problem with "no matching injection point for method" in rules which should be triggered.

       

      NOTE: I use ALL counter because of try - catch - finally block

       

      Byteman 3.0.2-SNAPSHOT

      wildfly-8.2.0.Final,

      weld-core-impl 2.2.6-FInal

      source code: GC: AbstractEJBRequestScopeActivationInterceptor - org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor (.jav…


      Here is the source code of method:

       

      public Object aroundInvoke(InvocationContext invocation) throws Exception {
      
      
              if (isRequestContextActive()) {
                  return invocation.proceed();
              } else {
                  EjbRequestContext requestContext = getEjbRequestContext();
                  try {
                      requestContext.associate(invocation);
                      requestContext.activate();
                      try {
                          // An event with qualifier @Initialized(RequestScoped.class) is fired when the request context is initialized
                          getBeanManager().getGlobalLenientObserverNotifier().fireEvent(new Object(), InitializedLiteral.REQUEST);
                          return invocation.proceed();
                      } finally {
                          requestContext.invalidate();
                          requestContext.deactivate();
                      }
                  } finally {
                      requestContext.dissociate(invocation);
                      // An event with qualifier @Destroyed(RequestScoped.class) when the request context is destroyed
                      getBeanManager().getGlobalLenientObserverNotifier().fireEvent(new Object(), DestroyedLiteral.REQUEST);
                  }
              }
          }
      
      

       

      and rules:

      #Log AbstractEJBRequestScopeActivationInterceptor - associate request context
      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.associtateContext
      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor
      METHOD aroundInvoke(InvocationContext)
      AT INVOKE org.jboss.weld.context.BoundContext.associate(InvocationContext)
      IF true
      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Associating the request context with the storage, storage instance: " + $instance)
      ENDRULE
      
      
      #Log AbstractEJBRequestScopeActivationInterceptor - activate request context
      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.activateContext
      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor
      METHOD aroundInvoke(InvocationContext)
      AT INVOKE org.jboss.weld.context.ManagedContext.activate()
      IF true
      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Activating request context.")
      ENDRULE
      
      
      #Log AbstractEJBRequestScopeActivationInterceptor - invalidate request context
      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.invalidateContext
      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor
      METHOD aroundInvoke(InvocationContext)
      AT INVOKE org.jboss.weld.context.ManagedContext.invalidate() ALL
      IF true
      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Invalidating the request context as due for destruction when deactivate is called.")
      ENDRULE
      
      
      #Log AbstractEJBRequestScopeActivationInterceptor - deactivate request context
      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.deactivateContext
      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor
      METHOD aroundInvoke(InvocationContext)
      AT INVOKE org.jboss.weld.context.ManagedContext.deactivate() ALL
      IF true
      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Deactivating the request context, destroying any instances if the context is invalid.")
      ENDRULE
      
      
      #Log AbstractEJBRequestScopeActivationInterceptor - dissociate request context
      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.dissociateContext
      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor
      METHOD aroundInvoke(InvocationContext)
      AT INVOKE org.jboss.weld.context.BoundContext.dissociate(InvocationContext) ALL
      IF true
      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Dissociating the request context from the storage, storage instance: " + $instance +
        ". Creating an event with qualifier @Destroyed(RequestScoped.class) which is fired when the request context is destroyed.")
      ENDRULE
      
      

       

      When I run bmsubmit, it gives me following result:

       

      # File /home/koubsky/byteman-wildfly-log/rules/ejb.btm line 13

      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.associtateContext

      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      METHOD aroundInvoke(InvocationContext)

      HELPER org.jboss.byteman.koubsky.LogHelper

      AT INVOKE org.jboss.weld.context.BoundContext.associate(InvocationContext)

      IF true

      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Associating the request context with the storage, storage instance: " + $instance)

      ENDRULE

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger method: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      threw org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      at org.jboss.byteman.agent.TransformContext.warn(TransformContext.java:243)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.checkBindings(RuleCheckMethodAdapter.java:71)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.visitEnd(RuleCheckMethodAdapter.java:212)

      at org.jboss.byteman.objectweb.asm.ClassReader.b(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:121)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger class: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      threw org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      at org.jboss.byteman.agent.TransformContext.notifyRules(TransformContext.java:326)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:169)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

      # File /home/koubsky/byteman-wildfly-log/rules/ejb.btm line 40

      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.deactivateContext

      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      METHOD aroundInvoke(InvocationContext)

      HELPER org.jboss.byteman.koubsky.LogHelper

      AT INVOKE org.jboss.weld.context.ManagedContext.deactivate()  ALL

      IF true

      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Deactivating the request context, destroying any instances if the context is invalid.")

      ENDRULE

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger method: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      threw org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      at org.jboss.byteman.agent.TransformContext.warn(TransformContext.java:243)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.checkBindings(RuleCheckMethodAdapter.java:71)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.visitEnd(RuleCheckMethodAdapter.java:212)

      at org.jboss.byteman.objectweb.asm.ClassReader.b(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:121)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger class: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      threw org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      at org.jboss.byteman.agent.TransformContext.notifyRules(TransformContext.java:326)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:169)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

      # File /home/koubsky/byteman-wildfly-log/rules/ejb.btm line 49

      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.dissociateContext

      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      METHOD aroundInvoke(InvocationContext)

      HELPER org.jboss.byteman.koubsky.LogHelper

      AT INVOKE org.jboss.weld.context.BoundContext.dissociate(InvocationContext)  ALL

      IF true

      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Dissociating the request context from the storage, storage instance: " + $instance +

      ". Creating an event with qualifier @Destroyed(RequestScoped.class) which is fired when the request context is destroyed.")

      ENDRULE

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger method: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      threw org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      at org.jboss.byteman.agent.TransformContext.warn(TransformContext.java:243)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.checkBindings(RuleCheckMethodAdapter.java:71)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.visitEnd(RuleCheckMethodAdapter.java:212)

      at org.jboss.byteman.objectweb.asm.ClassReader.b(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:121)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger class: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      threw org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      at org.jboss.byteman.agent.TransformContext.notifyRules(TransformContext.java:326)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:169)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

      # File /home/koubsky/byteman-wildfly-log/rules/ejb.btm line 22

      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.activateContext

      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      METHOD aroundInvoke(InvocationContext)

      HELPER org.jboss.byteman.koubsky.LogHelper

      AT INVOKE org.jboss.weld.context.ManagedContext.activate()

      IF true

      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Activating request context.")

      ENDRULE

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger method: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      threw org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      at org.jboss.byteman.agent.TransformContext.warn(TransformContext.java:243)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.checkBindings(RuleCheckMethodAdapter.java:71)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.visitEnd(RuleCheckMethodAdapter.java:212)

      at org.jboss.byteman.objectweb.asm.ClassReader.b(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:121)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger class: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      threw org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      at org.jboss.byteman.agent.TransformContext.notifyRules(TransformContext.java:326)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:169)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

      # File /home/koubsky/byteman-wildfly-log/rules/ejb.btm line 31

      RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.invalidateContext

      CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      METHOD aroundInvoke(InvocationContext)

      HELPER org.jboss.byteman.koubsky.LogHelper

      AT INVOKE org.jboss.weld.context.ManagedContext.invalidate()  ALL

      IF true

      DO log($CLASS, "DEBUG", "(Method aroundInvoke) Invalidating the request context as due for destruction when deactivate is called.")

      ENDRULE

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger method: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      threw org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

      at org.jboss.byteman.agent.TransformContext.warn(TransformContext.java:243)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.checkBindings(RuleCheckMethodAdapter.java:71)

      at org.jboss.byteman.agent.adapter.RuleCheckMethodAdapter.visitEnd(RuleCheckMethodAdapter.java:212)

      at org.jboss.byteman.objectweb.asm.ClassReader.b(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.objectweb.asm.ClassReader.accept(Unknown Source)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:121)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

      Transformed in:

      loader: ModuleClassLoader for Module "org.jboss.weld.core:main" from local module loader @6dae04e2 (finder: local module finder @3bc2c9af (roots: /home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules,/home/koubsky/Wildfly8/wildfly-8.2.0.Final/modules/system/layers/base))

      trigger class: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      threw org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      org.jboss.byteman.rule.exception.TypeWarningException: failed to find any matching trigger method in class org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor

      at org.jboss.byteman.agent.TransformContext.notifyRules(TransformContext.java:326)

      at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:169)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:746)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:814)

      at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:785)

      at org.jboss.byteman.agent.Transformer.transform(Transformer.java:257)

      at sun.instrument.TransformerManager.transform(TransformerManager.java:188)

      at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

      at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)

      at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

      at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:144)

      at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:349)

      at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:272)

      at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:225)

      at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:158)

       

      Thanks for help.

        • 1. Re: No matching injection point for method ...
          Andrew Dinn Master

          Hi Radek,

           

          Let's look at the first rule where we get a warning about a match failure

           

          org.jboss.byteman.rule.exception.TypeWarningException: no matching injection point for method aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

           

          The TypeWarning says "I found a trigger class with a method which matches the target CLASS and METHOD clause but I could not inject the rule at the target location".

           

          So how about the rule?

           

          RULE logAbstractEJBRequestScopeActivationInterceptor.aroundInvoke.associtateContext
          CLASS org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor
          METHOD aroundInvoke(InvocationContext)
          HELPER org.jboss.byteman.koubsky.LogHelper
          AT INVOKE org.jboss.weld.context.BoundContext.associate(InvocationContext)
          IF true
          DO log($CLASS, "DEBUG", "(Method aroundInvoke) Associating the request context with the storage, storage instance: " + $instance)
          ENDRULE
          

           

          bmsubmit shows that the CLASS and METHOD clause appear to have identified the intended method

           

          trigger method: org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(javax.interceptor.InvocationContext) java.lang.Object

           

          Ok, so what about the location? The location clause identifies method org.jboss.weld.context.BoundContext.associate(InvocationContext).  I assume this means that the AT clause is meant to idenitfy  this method call in the else block

           

            . . .
            } else {
              EjbRequestContext requestContext = getEjbRequestContext();
              try {
                requestContext.associate(invocation);
                requestContext.activate();
            . . .
          

           

          The type of the local variable requestContext is EjbRequestContext which is an interface. Note that type is also what those of us in the compiler business call the lexical type for the local var i.e. it's the type that the compiler (and therefore the bytecode) can know at compile time will be valid for any actual value which gets assigned to it at runtime. So, when the bytecode is generated it includes a bytecode instruction which essentially says

           

            invoke interface method EjbRequestContext.associate(InvocationContext) of whatever object is bound to local variable requestContext

           

          The bytecode doesn't know or care about the type of any instance which actually gets bound to requestContex. It doesn't have ot because it knows that Java cocode is type safe. So, any value returned by getEJBRequestContext must be an implementation of EJBRequestContext, whatever it's acual type. All it does is look up the table of interface methods attached to that instance and pick the one called associate(InvocationContext).

           

          Now your rule specifies the AT CALL target location using a fully qualified method name org.jboss.weld.context.BoundContext.associate(InvocationContext). You could have just used AT INVOKE associate(InvocationContext) and that would match the call . But specifying an implementation belonging to a specific classmeans it doesn't match. The call has type EJBRequestContext and your rule says look for a call where the method belongs to BoundContext.

           

          Now before I go on to explain why that is a mismatch I'll mention that I did a bit of googling and it looks to me as if BoundContext does not actually implement interface EJBRequestContext. So, this specific call site is never going to involve a call to BoundContext.associate, even one hidden behind an interface. But, let's ignore that because I think there is still another problem here that you have need to understand.

           

          Let's assume that BoundContext does actually implement EJBRequestContext. In that case the object bound to requestContext at runtime might indeed turn out to be an instance of BoundContext. That's normally described as saying that the dynamic type of requestContext is BoundContext. Well, the problem here is that Byteman doesn't know or care about dynamic types when it is modifying bytecode. It only considers the lexical types attached to the bytecode instructions because that's also the only thing that is present in the source code. Byteman doesn't see any call to BoundContext.associate in the byecode because you don't see any call to BoundContext.associate in he source code. What Byteman does see is a call to EjbRequestContext.associate which is exactly what you can see in the source code. And that doesn't match the AT INVOKE specification. If you change the location to AT CALL EJBRequestContext.associate(InvocationContext) then you will get a match. It will also match if you just specify AT CALL associate(InvocationContext) or  AT CALL associate.then you will get a match.

           

          Why does Byteman do this? Well, two reasons. Firstly, the point of Byteman is to ensure that you can do code transformation at the Java level. So, when your rule refers to elements of the source code you have to refer to them using the same types as are used in the source code and only those types. That stops youu from injecting code that is not type-safe. requestContext has type EJBRequestCotntext so the method call has type boolean EJBRequestContext.associate(InvocationContext) and the AT clause needs to use a matching method type if it wants to refer to that call. If you don't want to be specific you can omit the return type, signature or class but what you cannot do is specify a class that does not appear in the code.

           

          Secondly, think about what would be needed in order for things to work the way you assume it to work. Byteman would have to do several things that it currently doesn't do. First it would have to work out that BoundContext is an implementation of EJBRequestContext (for various reasons to do with limitations on what bytecode transformers can do to validate class hierarchies at transform time that's makes this a complete non-starter). Second, it would then have to identify that the call to requestContext.associate() could indeed be a call to BoundContext.associate() i.e. that the method is actually implemented in class BoundContext (rather than, say, inherited from a parent). Third it would have to inject code into the target location which checked the dynamic type of the object bound to requestContext and only trigger the rule when it  was actually an instance of BoundContext (or any of its subtypes). This is not possible and, actually, not really very helpful.

           

          I believe the lexical vs dynamic scope naming issue is what is causing the problem with your other rules.

           

          n.b. There is a secondary problem in this rule (and maybe in some of the others?). This rule mentionsa  local variable $instance. At the injection point there is no local variable wiht that name in scope. This will also cause a match failure even if you fix the AT clause.

          • 2. Re: No matching injection point for method ...
            Radek Koubský Newbie

            Thanks for the clarification.

            I really missed the BoundContext at the location specifier. I just copy pasted source code from eclipse without thinking. I looked at the class hierarchy (which starts from interface Context and it is really big) and it is defined in opposite way, the EjbRequestContext:

            public interface EjbRequestContext extends RequestContext, BoundContext<InvocationContext> {
            
            
            }
            

            extends the BoundContext<S> which contains the associate(S storage) method:

            public interface BoundContext<S> extends AlterableContext {
            
            
                /**
                 * Associate the context with the storage (for this thread). Once {@link #associate(Object)} has been called, further calls
                 * to {@link #associate(Object)} will be ignored, until the context has been subsequently {@link #dissociate(Object)} from
                 * the storage.
                 *
                 * @param storage the external storage
                 * @return true if the storage was attached, otherwise false
                 */
                boolean associate(S storage);
            
            
                /**
                 * Dissociate the context from the storage (for this thread). The context will only dissociate from the same storage it
                 * associated with.
                 *
                 * @param storage the external storage
                 * @return true if the storage was dissociated
                 */
                boolean dissociate(S storage);
            
            
            }
            

             

            When I changed the location to EjbRequestContext, it matches injection point for the rule (and for the other rules as well). After this mistake, I consider using more common description for location specifier e.g. only method name...


            To the second problem:

            You are right, there must be $invocation instead of $instance.