[jboss-jira] [JBoss JIRA] Created: (EJBTHREE-1206) Interceptors do not work on @WebService EJBs without @Remote, @Local, or @Service

Ryan Carmichael (JIRA) jira-events at lists.jboss.org
Thu Mar 6 19:29:57 EST 2008


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

                 Key: EJBTHREE-1206
                 URL: http://jira.jboss.com/jira/browse/EJBTHREE-1206
             Project: EJB 3.0
          Issue Type: Bug
          Components: interceptors
    Affects Versions: AS 4.2.2.GA
         Environment: JBoss Portal 2.6.4 (AS 4.2.2) on x86 Windows XP Sun JVM 1.5_09
            Reporter: Ryan Carmichael


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


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list