CDI Observer Annotated with @Stateless Receives two Events (Doc ID 1545987.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Weblogic Server - Version 12.1.1.0 and later
Information in this document applies to any platform.

Symptoms

Using 12.1.1 WLS server, the issue  is that an observer bean 's method is invoked twice when firing an event .


1/ An EJB method ( fireCDIEvent) is invoked :


The problem is that when calling testHandler.fire for one event,
the EJB observer bean method (testObserver method) is called two times .

In our example above, when fireCDIEvent ()  method is invoked, testObserver () method is called twice so the following output  is displayed : 

'

Test
1
Test
1

'

The expected behaviour is that testObserver method is invoked only one time when an event is fired.

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