Payara: Missing EEModuleDescriptor leads to Weld warning

Created on 15 Jan 2018  路  6Comments  路  Source: payara/Payara

# Description #

Upon deploying an application to Payara 4.1.2.174, Weld produces a warning log entry saying that

@Initialized and @Destroyed events for ApplicationScoped may be fired twice

Expected Outcome

No warning should occur, as is the case with Payara 4.1.2.173 and before. If the potential consequence described in the log message can actually occur, this could for example lead to problems with the eager initialization pattern based on @Observes @Initialized(ApplicationScoped.class) (cf. https://stackoverflow.com/questions/3600534/how-do-i-force-an-application-scoped-bean-to-instantiate-at-application-startup/32520226#32520226).

Current Outcome

The exact log message is:

WARN: WELD-000718: No EEModuleDescriptor defined for bean archive with ID: AsyncJaxRsTest.war. @Initialized and @Destroyed events for ApplicationScoped may be fired twice.

Steps to reproduce

Deploy any module with a beans.xml.

Samples

Minimal example: deploy a module with only a beans.xml like this (no further source code required):

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>

Context

It looks like "EE Modules" is a new feature in Weld, as described here: http://docs.jboss.org/weld/reference/latest/en-US/html/ri-spi.html#_ee_modules.

I'm not sure, but the wording "... the integrator should create an instance of the EEModuleDescriptor ..." sounds to me like the container is meant, i.e. Payara in this case...? I tried to get rid of this by following the instructions at http://docs.jboss.org/weld/reference/latest/en-US/html/ri-spi.html#_registering_services, i.e. creating a file META-INF/services/org.jboss.weld.bootstrap.api.Service with a single line containing the FQN of a class implementing EEModuleDescriptor like this:

@Override
public void cleanup()
{}

@Override
public String getId()
{
  return "ModuleId";
}

@Override
public ModuleType getType()
{
  return ModuleType.WEB;
}

This indeed makes the log entry go away. So it seems to me that, according to the Weld documentation, Payara should be generating such implementations dynamically (with an ID based on the module name).

When I searched for the log message, I found at least one other recent post that exhibits the same problem (https://stackoverflow.com/questions/48074073/how-to-use-omnifaces-eager-annotation-with-primefaces#comment83254600_48074073).

Environment

  • Payara Version: 4.1.2.174
  • Edition: Full
  • JDK Version: 8u131 OpenJDK
  • Operating System: Debian Linux
  • Database: PostgreSQL
Accepted

Most helpful comment

The fix needs to be backported to 4.x

All 6 comments

This is internal issue PAYARA-2310

Not a problem in Payara 5

I saw this message with 181 build, too. How can this be fixed?

The fix needs to be backported to 4.x

Thanks once again!

Was this page helpful?
0 / 5 - 0 ratings