A Method Annotated @PostConstruct Is Ignored In A POJO JAX-WS When The "WEB-INF/bean.xml" Exists (Doc ID 1949343.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle WebLogic Server - Version 12.1.2.0.0 and later
Information in this document applies to any platform.

Symptoms

When the "WEB-INF/bean.xml" file exists in WAR, the method annotated with @PostConstruct is not invoked:
INFO 04:07:24,584 MockService02 - MockService02()--->C O N S T R U C T O R
INFO 04:07:24,696 MockService01 - MockService01()--->C O N S T R U C T O R

when the file does not exist (ex: WEB-INF/bean.xmlxx), the method works:
INFO 04:11:04,220 MockService02 - MockService02()--->C O N S T R U C T O R
INFO 04:11:04,220 MockService02 - init()--->P O S T C O N S T R U C T O R

Attaching the testcase.

Refs:
http://docs.oracle.com/javaee/7/api/javax/annotation/PostConstruct.html

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms