Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong number of arguments using interceptor #3440

Closed
eduarddrenth opened this issue Nov 20, 2018 · 7 comments
Closed

wrong number of arguments using interceptor #3440

eduarddrenth opened this issue Nov 20, 2018 · 7 comments
Assignees
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Bug Label issue as a bug defect
Milestone

Comments

@eduarddrenth
Copy link

Description


An interceptor having two methods with the same name may cause a hard to find IllegalArgumentException, the interceptor method is not being called.

Expected Outcome

The interceptor method with the InvocationContext is called, the other method ignored.

Current Outcome

  wrong number of arguments
java.lang.IllegalArgumentException: wrong number of arguments
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
        at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
        at sun.reflect.GeneratedMethodAccessor472.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
        at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
        at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
        at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
        at sun.reflect.GeneratedMethodAccessor466.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
        at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:374)
        at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4839)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4827)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
        at com.sun.proxy.$Proxy707.update(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.jboss.weld.util.reflection.Reflections.invokeAndUnwrap(Reflections.java:410)
        at org.jboss.weld.module.ejb.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:134)
        at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)
        at org.jboss.weld.module.ejb.InjectionPointPropagatingEnterpriseTargetBeanInstance.invoke(InjectionPointPropagatingEnterpriseTargetBeanInstance.java:68)
        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:106)

Steps to reproduce (Only for bug reports)

Create an interceptor with these methods:

    @AroundInvoke
    public Object checkAccess(InvocationContext ctx) throws Exception {
    private void checkAccess(Object arg, Auditing auditing, SecurityContext securityContext) throws

Use the interceptor on a local stateless EJB method:

@Interceptors({AccessInterceptor.class})
public ......

Environment

  • Payara Version: 5.183
  • Edition: Full
  • JDK Version: OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.18.04.1-b13)
  • Operating System: Linux
@rdebusscher
Copy link

Hi Eduard,

I cannot reproduce this with a simple reproducer.
I have declared an interceptor, a Stateless EJB and a servlet which calls the EJB method. (See maven project in attachment)

Can you update the reproducer to match your situation?

Github3440.zip

Regards
Rudy

@eduarddrenth
Copy link
Author

Cannot open the zip on my linux, looks like the zip is made on mac? Can you provide tgz?

@rdebusscher
Copy link

tgz files are not supported as attachments. You can download the tgz with the following link https://drive.google.com/open?id=15Dvbl_8CpGyCMzpKjlCyk6YGuxFQ8Lcb

@eduarddrenth
Copy link
Author

this makes it fail:
git3440.zip

tried to narrow down more, but did not succeed in that yet

@rdebusscher
Copy link

We found the cause of this issue.

In some situations, the selection of the actual method which gets invoked during the interceptor execution is the wrong one (not the one annotated which is annotated).

An internal Jira ticket is created to fix this issue.

We keep you informed when changes are available in a release.

@rdebusscher rdebusscher added Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Bug Label issue as a bug defect in development and removed 1:Investigating labels Nov 26, 2018
@smillidge
Copy link
Contributor

Fixed by #3454

@smillidge smillidge added this to the 5.191 milestone Jan 29, 2019
@eduarddrenth
Copy link
Author

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Bug Label issue as a bug defect
Projects
None yet
Development

No branches or pull requests

3 participants