EJB 3.0
  1. EJB 3.0
  2. EJBTHREE-1206

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

    Details

    • Type: Bug Bug
    • Status: Open Open (View Workflow)
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: AS 4.2.2.GA
    • Fix Version/s: None
    • Component/s: interceptors
    • Labels:
      None
    • Environment:
      JBoss Portal 2.6.4 (AS 4.2.2) on x86 Windows XP Sun JVM 1.5_09
    • Similar Issues:
      Show 10 results 

      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(); }

      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ryan Carmichael
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: