-
Bug
-
Resolution: Done
-
Major
-
2.0.0.Beta7
-
None
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()
public void foo()
{ System.out.println("In SomeManagedBean::foo() "); } @PreDestroy
private void destroy()
}
// Interceptor
public class InterceptorA {
@AroundConstruct
private void create(InvocationContext ctx) {
System.out.println("In InterceptorA.AroundConstruct");
try
}
@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
}
I'm finding that the interceptor's @PostConstruct method is not being invoked. The @AroundConstruct method does appear to be invoked though.
- is related to
-
WELD-1945 Interceptor bindings for lifecycle callbacks should be allowed on types only
- Resolved