My Oracle Support Banner

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

Last updated on OCTOBER 17, 2023

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 behavior is that testObserver method is invoked only one time when an event is fired.

Changes

 

Cause

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
Symptoms
Changes
Cause
Solution
References


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