Issue Type: Bug Bug
Affects Versions: 2.0.0.Beta7
Assignee: Jozef Hartinger
Components: Interceptors and Decorators
Created: 01/Apr/13 11:16 AM
Description:

For the following classes (EJB, managed bean, and an interceptor)...

// EJB
@Stateless
public class StatelessEJB {

@Resource private SomeManagedBean mb;

public String sayHello()

{ mb.foo(); return "Hello"; }

}

// Managed Bean
@ManagedBean("somemanagedbean")
@Interceptors(InterceptorA.class)
public class SomeManagedBean {

@PostConstruct
private void init()

{ System.out.println("In SomeManagedBean::init() " + this); }

public void foo()

{ System.out.println("In SomeManagedBean::foo() "); }

@PreDestroy
private void destroy()

{ System.out.println("In SomeManagedBean::destroy() "); }

}

// Interceptor
public class InterceptorA {

@AroundConstruct
private void create(InvocationContext ctx) {
System.out.println("In InterceptorA.AroundConstruct");
try

{ ctx.proceed(); } catch (Exception e) { throw new RuntimeException(e); }
}

@PostConstruct // THIS METHOD IS NEVER INVOKED
private void afterCreation(InvocationContext ctx) {
System.out.println("In InterceptorA.PostConstruct");
try { ctx.proceed(); }

catch (Exception e)

{ throw new RuntimeException(e); }
}

@PreDestroy
private void preDestroy(InvocationContext ctx) {
System.out.println("In InterceptorA.PreDestroy");
try { ctx.proceed(); } catch (Exception e) { throw new RuntimeException(e); }

}

@AroundInvoke
public Object interceptCall(InvocationContext ctx) throws Exception

{ System.out.println("In InterceptorA.AroundInvoke"); return ctx.proceed(); }

}

I'm finding that the interceptor's @PostConstruct method is not being invoked. The @AroundConstruct method does appear to be invoked though.

Environment: @PostConstruct method of @Resource-injected ManagedBeans' interceptors are not being invoked.
Project: Weld
Priority: Major Major
Reporter: Phil Zampino
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira