Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helidon cdi tck patch #23990

Merged
merged 3 commits into from
Jun 14, 2022
Merged

Helidon cdi tck patch #23990

merged 3 commits into from
Jun 14, 2022

Conversation

MattGill98
Copy link
Contributor

The new Config implementation will throw an exception when a synthetic observer is registered. This change patches the CDI Extension class to ignore these synthetic observers.

Observing ConfigProperties isn't a valid use of MP Config anyway, so no functionality is lost.

@arjantijms arjantijms added this to the 7.0.0 milestone Jun 13, 2022
@MattGill98
Copy link
Contributor Author

Helidon PR made: helidon-io/helidon#4382

@arjantijms
Copy link
Contributor

@MattGill98 @dmatej

Probably some extra dependencies need to be added to the embedded config:

19:49:44       [java] org.glassfish.deployment.common.DeploymentException: CDI deployment failure:Error instantiating :io.helidon.microprofile.config.ConfigCdiExtension
19:49:44       [java] 	at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:442)
19:49:44       [java] 	at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:107)
19:49:44       [java] 	at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:332)
19:49:44       [java] 	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:532)
19:49:44       [java] 	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:258)
19:49:44       [java] 	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:467)
19:49:44       [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:516)
19:49:44       [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:512)
19:49:44       [java] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
19:49:44       [java] 	at java.base/javax.security.auth.Subject.doAs(Subject.java:365)
19:49:44       [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:511)
19:49:44       [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:542)
19:49:44       [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:534)
19:49:44       [java] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
19:49:44       [java] 	at java.base/javax.security.auth.Subject.doAs(Subject.java:365)
19:49:44       [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:533)
19:49:44       [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1441)
19:49:44       [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1823)
19:49:44       [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1699)
19:49:44       [java] 	at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:108)
19:49:44       [java] 	at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:84)
19:49:44       [java] 	at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:114)
19:49:44       [java] 	at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:110)
19:49:44       [java] 	at jakarta.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:91)
19:49:44       [java] 	at jakarta.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:71)
19:49:44       [java] 	at com.acme.Client.test(Client.java:49)
19:49:44       [java] 	at com.acme.Client.main(Client.java:39)
19:49:44       [java] Caused by: java.util.ServiceConfigurationError: Error instantiating :io.helidon.microprofile.config.ConfigCdiExtension
19:49:44       [java] 	at org.jboss.weld.util.ServiceLoader.createInstance(ServiceLoader.java:315)
19:49:44       [java] 	at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:247)
19:49:44       [java] 	at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:215)
19:49:44       [java] 	at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:185)
19:49:44       [java] 	at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:165)
19:49:44       [java] 	at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:289)
19:49:44       [java] 	at org.glassfish.weld.DeploymentImpl.getExtensions(DeploymentImpl.java:283)
19:49:44       [java] 	at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:361)
19:49:44       [java] 	... 26 more
19:49:44       [java] Caused by: java.lang.NoClassDefFoundError: io/helidon/config/ConfigException
19:49:44       [java] 	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
19:49:44       [java] 	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3344)
19:49:44       [java] 	at java.base/java.lang.Class.getConstructor0(Class.java:3549)
19:49:44       [java] 	at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2726)
19:49:44       [java] 	at org.jboss.weld.util.ServiceLoader.createInstance(ServiceLoader.java:311)
19:49:44       [java] 	... 33 more
19:49:44       [java] Caused by: java.lang.ClassNotFoundException: io.helidon.config.ConfigException
19:49:44       [java] 	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:432)
19:49:44       [java] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:586)
19:49:44       [java] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
19:49:44       [java] 	... 38 more

The embedded dependencies needed not inlining, as by default
they overwrite classes from the main module. This isn't the case
when using the 'unpackBundle' option, but that causes module-info
files from the dependencies to break compilation. A sensible option
seems to be to not inline the dependencies.

Note that the overwritten class causes the single artifact it comes
from to be inlined.

Signed-off-by: Matthew Gill <matthew.gill@live.co.uk>
The Helidon Config CDI extension will no longer throw exceptions
when synthetic observers are encountered.

Signed-off-by: Matthew Gill <matthew.gill@live.co.uk>
Exceptions are stored in this package, so need exposing.

Signed-off-by: Matthew Gill <matthew.gill@live.co.uk>
@arjantijms arjantijms merged commit e2e37e3 into eclipse-ee4j:master Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants