Hi Scott,

    I've upgraded my 3.1..s080202 snapshot to release 3.1.5 today, and found
my intercepted components broken.
    After some examinations, I think the problem should be the runtime
weaver who was responsible to generate code for webbeans component annotated
to be intercepted.
    The attachment is an IntelliJ IDEA project which contains a trivial
servlet calling a injected service to output "hello" to html out. There're
four classes below:

================the binding type, no problem============
package com.mycompany.interceptors;

import javax.webbeans.InterceptorBindingType;
import java.lang.annotation.*;

@Target({ElementType.METHOD, ElementType.TYPE})
public @interface Cachable {

================the interceptor, no problem============
package com.mycompany.interceptors;

import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;
import javax.webbeans.Interceptor;

public class CacheInterceptor {

 public CacheInterceptor() {

 public Object invoke(final InvocationContext invocation) throws Throwable {
  return invocation.proceed();


================the servlet, no problem================
package com.mycompany.servlet;

import com.mycompany.services.TestService;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import javax.webbeans.In;
import java.io.IOException;

public class MyServlet extends HttpServlet {
 TestService service;
 protected void doGet(HttpServletRequest request, HttpServletResponse 
   throws ServletException, IOException {
  try {
  } catch (Exception e) {
   throw new ServletException(e);

================the service component, BUG!!!!!==========
package com.mycompany.services;

import com.mycompany.interceptors.Cachable;

import javax.webbeans.Component;

public class TestService {
 public TestService() {

 public String service() throws Exception { // todo bug: if not throws 
Exception, everything is ok
  return "hello";
Note the TODO in the service component code.

Sorry I sent an incomplete mail a minute ago.



resin-interest mailing list

Reply via email to