Skip to content

Commit

Permalink
WELD-2392 Log a warning when we detect bean module without EEModuleDe…
Browse files Browse the repository at this point in the history
…scriptor but with servlet listener.
  • Loading branch information
manovotn authored and mkouba committed Jun 9, 2017
1 parent c528f3c commit a79fcf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Expand Up @@ -92,4 +92,8 @@ public interface ServletLogger extends WeldLogger {
@Message(id = 717, value = "Unable to deactivate context {0} when destroying request {1}", format = Format.MESSAGE_FORMAT)
void unableToDeactivateContext(Object context, Object request);

@LogMessage(level = Level.WARN)
@Message(id = 718, value = "No EEModuleDescriptor defined for bean archive with ID: {0}. @Initialized and @Destroyed events for ApplicationScoped may be fired twice.", format = Format.MESSAGE_FORMAT)
void noEeModuleDescriptor(Object beanArchiveId);

}
Expand Up @@ -161,6 +161,7 @@ private void fireEventForApplicationScope(ServletContext ctx, Annotation qualifi
module.fireEvent(ServletContext.class, ctx, qualifier);
} else {
// fallback for backward compatibility
ServletLogger.LOG.noEeModuleDescriptor(beanManager);
final EventMetadata metadata = new EventMetadataImpl(ServletContext.class, null, Collections.singleton(qualifier));
beanManager.getAccessibleLenientObserverNotifier().fireEvent(ServletContext.class, ctx, metadata, qualifier);
}
Expand Down

0 comments on commit a79fcf2

Please sign in to comment.