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

4.x: OCI archetype server module throws UnsatisfiedResolutionException #8833

Open
barchetta opened this issue Jun 3, 2024 · 5 comments
Open
Assignees
Labels
4.x Version 4.x archetypes bug Something isn't working OCI P2
Projects

Comments

@barchetta
Copy link
Member

Environment Details

  • Helidon Version: 4.0.8
  • Helidon MP
  • JDK version: 21.0.3

Problem Description

Running the OCI archetype project server results in an exception (see below). This works with 4.0.7. Two problems:

  1. The exception does not clearly indicate what class is not resolvable.
  2. The sample fails to run
Exception in thread "main" jakarta.enterprise.inject.UnsatisfiedResolutionException
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at io.helidon.integrations.oci.sdk.cdi.OciExtension.lambda$installBasicAdp$25(OciExtension.java:1176)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$CreateCallback.create(BeanConfiguratorImpl.java:372)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$ImmutableBean.create(BeanConfiguratorImpl.java:511)
	at org.jboss.weld.contexts.AbstractContext.get(AbstractContext.java:96)
	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
	at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:679)
	at org.jboss.weld.bean.builtin.InstanceImpl.getBeanInstance(InstanceImpl.java:262)
	at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:114)
	at org.jboss.weld.util.ForwardingWeldInstance.get(ForwardingWeldInstance.java:44)
	at io.helidon.integrations.oci.sdk.cdi.OciExtension.produceClient(OciExtension.java:1325)
	at io.helidon.integrations.oci.sdk.cdi.OciExtension.lambda$installServiceClient$27(OciExtension.java:1279)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$CreateCallback.create(BeanConfiguratorImpl.java:372)
	at org.jboss.weld.bootstrap.events.configurator.BeanConfiguratorImpl$ImmutableBean.create(BeanConfiguratorImpl.java:511)
	at org.jboss.weld.contexts.AbstractContext.get(AbstractContext.java:96)
	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
	at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:679)
	at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:784)
	at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76)
	at org.jboss.weld.injection.StaticMethodInjectionPoint.getParameterValues(StaticMethodInjectionPoint.java:134)
	at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:85)
	at org.jboss.weld.injection.MethodInvocationStrategy$DefaultMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:144)
	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330)
	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308)
	at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286)
	at jakarta.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:142)
	at org.jboss.weld.util.Observers.notify(Observers.java:166)
	at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
	at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
	at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
	at io.helidon.microprofile.cdi.HelidonContainerImpl.doStart(HelidonContainerImpl.java:311)
	at io.helidon.common.context.Contexts.runInContext(Contexts.java:137)
	at io.helidon.microprofile.cdi.HelidonContainerImpl.start(HelidonContainerImpl.java:258)
	at io.helidon.microprofile.cdi.Main.main(Main.java:80)


Steps to reproduce

helidon init --version 4.0.8 --flavor mp --archetype oci --batch
cd oci-mp
mvn package
java -jar server/target/oci-mp-server.jar
@github-actions github-actions bot added this to Triage in Backlog Jun 3, 2024
@barchetta
Copy link
Member Author

barchetta commented Jun 3, 2024

Possibly related to PR #8486

@barchetta barchetta changed the title 4.x: OCI archetype server trhows UnsatisfiedResolutionException at runtime 4.x: OCI archetype server throws UnsatisfiedResolutionException Jun 3, 2024
@barchetta
Copy link
Member Author

Work-around is to edit the server/src/main/resources/META-INF/*.properties files and change occurrences of:

  • instance_principals to instance-principals
  • config_file to config-file
  • resource_principal to resource-principal

For example:

oci.auth-strategy=config-file,instance-principals,resource-principal

@ljnelson
Copy link
Member

ljnelson commented Jun 3, 2024

An easier workaround is to supply values on the command line as system properties. Also note the OciExtension javadoc that lists supported keys and values.

@m0mus m0mus added archetypes OCI 4.x Version 4.x bug Something isn't working P2 labels Jul 1, 2024
@m0mus m0mus changed the title 4.x: OCI archetype server throws UnsatisfiedResolutionException 4.x: OCI archetype server module throws UnsatisfiedResolutionException Jul 1, 2024
@m0mus m0mus moved this from Triage to Sprint Scope in Backlog Jul 1, 2024
@klustria
Copy link
Member

Was able to reproduce. Now looking at updating all occurrences of the old values to the new values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x archetypes bug Something isn't working OCI P2
Projects
Backlog
  
Sprint Scope
Development

No branches or pull requests

4 participants