My Oracle Support Banner

WLS 12.1.1: No Warning for @PostConstruct Method with No Parameter in Interceptor Class (Doc ID 1475812.1)

Last updated on APRIL 15, 2018

Applies to:

Oracle Weblogic Server - Version to [Release 12c]
Information in this document applies to any platform.


In WLS 10.3.6, when the @PostConstruct method in EJB Interceptor Class has no parameter, it throws exception, as below:

java.lang.IllegalArgumentException: Method "init" in class "org.example.test.interceptor.MyInterceptor" is defined as lifecycle callback method with annotation
@PostConstruct, but it should take an InvocationContext object as parameter in the case of EJB interceptor.
  at weblogic.j2ee.dd.xml.validator.lifecyclecallback.BaseValidator.error(
  at weblogic.j2ee.dd.xml.validator.lifecyclecallback.BaseValidator.error(
  at weblogic.j2ee.dd.xml.validator.lifecyclecallback.InterceptorValidator.checkParameters(
  at weblogic.j2ee.dd.xml.validator.AbstractAnnotationValidator.checkMethod(
  at weblogic.j2ee.dd.xml.validator.AbstractAnnotationValidator.validate(
  at weblogic.j2ee.dd.xml.validator.AnnotationValidatorVisitor.visitLifeCycleCallbackBean(
  at weblogic.j2ee.dd.xml.validator.AnnotationValidatorVisitor.visit(
  at weblogic.descriptor.internal.AbstractDescriptorBean.accept(
  at weblogic.descriptor.internal.AbstractDescriptorBean.accept(
  at weblogic.descriptor.internal.AbstractDescriptorBean.accept(

 However, in WLS 12.1.1, no exception is thrown, and the the class will be deployed successfully.  This difference in behavior looks to have broken the EJB 3.0 spec.




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.