Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-1206

Interceptors do not work on @WebService EJBs without @Remote, @Local, or @Service

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • AS 4.2.2.GA
    • interceptors
    • None

    Description

      EJB3 with @WebService and @Stateless only defined does not cause interceptors to be called. If you add @Remote, @Local, or @Service, everything works fine.

      The example code below does NOT cause the interceptor to be called. If you add "@Remote(TestWSIF.class)" under @Stateless, the interceptor works as expected.

      package org.example;

      import javax.ejb.Remote;
      import javax.ejb.Stateless;
      import javax.interceptor.Interceptors;
      import javax.jws.WebService;

      @WebService(serviceName="TestWS", portName="TestWSPort", endpointInterface="org.example.TestWSIF")
      @Stateless
      public class TestWS implements TestWSIF {
      @Interceptors(TestInterceptor.class)
      public void sayHello(String name)

      { System.out.println("Hello " + name); }

      }

      -------------------

      package org.example;

      import javax.jws.WebService;

      @WebService
      public interface TestWSIF {
      public void sayHello(String name);
      }

      -------------------
      package org.example;

      import javax.interceptor.AroundInvoke;
      import javax.interceptor.InvocationContext;

      public class TestInterceptor {
      @AroundInvoke
      public Object doStuff(InvocationContext ctx) throws Exception

      { System.out.println("Doing stuff"); return ctx.proceed(); }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            rcarmichael_jira Ryan Carmichael (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: