helidon-io / helidon

Java libraries for writing microservices
https://helidon.io
Apache License 2.0
3.52k stars 564 forks source link

Archetype-created project with Eclipse JNoSQL has injection errors at start-up #1648

Open tjquinno opened 4 years ago

tjquinno commented 4 years ago

Environment Details


Problem Description

This Slack conversation captures what we know about the problem: https://helidon.slack.com/archives/CCJBURFGE/p1586758530017600

At the time of this writing, the user has neither a Helidon reproducer nor stack traces from Helidon and this project's readme page shows the added dependencies and a Quarkus stack trace: https://github.com/mcrose/quarkus-jnosql-couchdb

In case that changes, below are copies of the relevant info from that page.

From the Slack conversation: If the user runs the MP starter at https://start.microprofile.io (which today uses Helidon 1.4.1), then adds dependencies for JNoSQL, the app runs fine. Using the Helidon archetype, though, produces errors like these during start-up. (The user reported that these errors are similar to the Helidon ones.)

[INFO] --- quarkus-maven-plugin:0.28.1:dev (default-cli) @ quarkus-jnosql-couchdb ---
Listening for transport dt_socket at address: 5005
16:38:14,299 INFO  [io.qua.dep.QuarkusAugmentor] Beginning quarkus augmentation
16:38:14,564 INFO  [org.jbo.threads] JBoss Threads version 3.0.0.Final
16:38:14,975 ERROR [io.qua.dev.DevModeMain] Failed to start Quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 2 deployment problems:
[1] Unsatisfied dependency for type org.jnosql.artemis.document.DocumentWorkflow and qualifiers [@Default]
        - java member: org.jnosql.artemis.document.DefaultDocumentTemplateProducer#workflow
        - declared on CLASS bean [types=[java.lang.Object, org.jnosql.artemis.document.DocumentTemplateProducer, org.jnosql.artemis.document.DefaultDocumentTemplateProducer], qualifiers=[@Default, @Any], target=org.jnosql.artemis.document.DefaultDocumentTemplateProducer]
[2] Unsatisfied dependency for type org.jnosql.artemis.reflection.ClassMappingExtension and qualifiers [@Default]
        - java member: org.jnosql.artemis.reflection.DefaultClassMappings#extension
        - declared on CLASS bean [types=[org.jnosql.artemis.reflection.DefaultClassMappings, org.jnosql.artemis.reflection.ClassMappings, java.lang.Object], qualifiers=[@Default, @Any], target=org.jnosql.artemis.reflection.DefaultClassMappings]
...
        Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.jnosql.artemis.document.DocumentWorkflow and qualifiers [@Default]
        - java member: org.jnosql.artemis.document.DefaultDocumentTemplateProducer#workflow
        - declared on CLASS bean [types=[java.lang.Object, org.jnosql.artemis.document.DocumentTemplateProducer, org.jnosql.artemis.document.DefaultDocumentTemplateProducer], qualifiers=[@Default, @Any], target=org.jnosql.artemis.document.DefaultDocumentTemplateProducer]
                at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:472)
                at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:404)
                at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:212)
                ... 14 more
        Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.jnosql.artemis.reflection.ClassMappingExtension and qualifiers [@Default]
        - java member: org.jnosql.artemis.reflection.DefaultClassMappings#extension
        - declared on CLASS bean [types=[org.jnosql.artemis.reflection.DefaultClassMappings, org.jnosql.artemis.reflection.ClassMappings, java.lang.Object], qualifiers=[@Default, @Any], target=org.jnosql.artemis.reflection.DefaultClassMappings]
                at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:472)
                at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:404)
                at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:212)
                ... 14 more

Dependency additions:

    <dependency>
        <groupId>org.jnosql.artemis</groupId>
        <artifactId>artemis-document</artifactId>
        <version>${jnosql.version}</version>
    </dependency>
    <dependency>
        <groupId>org.jnosql.diana</groupId>
        <artifactId>couchdb-driver</artifactId>
        <version>${jnosql.version}</version>
    </dependency>
otaviojava commented 2 years ago

I tested, and there is no trace it just ignores the extensions:

2022.06.22 18:18:55 INFO io.helidon.common.LogConfig !thread!: Logging at initialization configured using classpath: /logging.properties
2022.06.22 18:18:55 INFO org.jboss.weld.Version !thread!: WELD-000900: 3.1.6 (Final)
2022.06.22 18:18:55 INFO org.jboss.weld.Bootstrap !thread!: WELD-ENV-000020: Using jandex for bean discovery
2022.06.22 18:18:55 INFO org.jboss.weld.Bootstrap !thread!: WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
2022.06.22 18:18:55 INFO org.jboss.weld.Event !thread!: WELD-000411: Observer method [BackedAnnotatedMethod] private io.helidon.microprofile.openapi.OpenApiCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<X>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2022.06.22 18:18:55 INFO org.jboss.weld.Event !thread!: WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jersey.ext.cdi1x.internal.ProcessAllAnnotatedTypes.processAnnotatedType(@Observes ProcessAnnotatedType<?>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2022.06.22 18:18:56 INFO org.jboss.weld.Bootstrap !thread!: WELD-ENV-002001: Weld SE container 3da2625e-5c29-4f3c-9f5c-94bcf9d41c82 shut down
Exception in thread "main" org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type ProductRepository with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private com.architects4j.workshop.microstream.helidon.product.ProductResource.repository
  at com.architects4j.workshop.microstream.helidon.product.ProductResource.repository(ProductResource.java:0)

I believe it is related to this one: https://github.com/oracle/helidon/issues/2431

the code sample is here:

https://github.com/architects4j/helidon-challange-skeleton/tree/main/acme-store-service-2

The weird part is that it works using the same idea with Microstream:

https://github.com/architects4j/helidon-challange-skeleton/tree/main/acme-store-service-1