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

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 #2

Open
dartartem opened this issue Jan 29, 2021 · 3 comments

Comments

@dartartem
Copy link
Contributor

dartartem commented Jan 29, 2021

* What went wrong:
Execution failed for task ':orders-service:quarkusBuild'.
> 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: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.validation.Validator and qualifiers [@Default]
        - java member: io.quarkus.arc.runtime.config.ConfigPropertiesProducer#produceEventuateKafkaConsumerQuarkusConfigurationProperties()
        - declared on PRODUCER METHOD bean [types=[io.eventuate.messaging.kafka.quarkus.basic.consumer.EventuateKafkaConsumerQuarkusConfigurationProperties, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.messaging.kafka.quarkus.basic.consumer.EventuateKafkaConsumerQuarkusConfigurationProperties produceEventuateKafkaConsumerQuarkusConfigurationProperties(org.eclipse.microprofile.config.Config, javax.validation.Validator), declaringBean=io.quarkus.arc.runtime.config.ConfigPropertiesProducer]
        at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1055)
        at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:245)
        at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:129)
        at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:423)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
        at java.lang.Thread.run(Thread.java:748)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)
  Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.validation.Validator and qualifiers [@Default]
        - java member: io.quarkus.arc.runtime.config.ConfigPropertiesProducer#produceEventuateKafkaConsumerQuarkusConfigurationProperties()
        - declared on PRODUCER METHOD bean [types=[io.eventuate.messaging.kafka.quarkus.basic.consumer.EventuateKafkaConsumerQuarkusConfigurationProperties, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.messaging.kafka.quarkus.basic.consumer.EventuateKafkaConsumerQuarkusConfigurationProperties produceEventuateKafkaConsumerQuarkusConfigurationProperties(org.eclipse.microprofile.config.Config, javax.validation.Validator), declaringBean=io.quarkus.arc.runtime.config.ConfigPropertiesProducer]
        at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:484)
        at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:378)
        at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:237)
        ... 14 more``
@dartartem
Copy link
Contributor Author

Problem was in compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion"

Chris:

Why does the order service need rest template from spring?

CustomerServiceProxy uses it to make calls to customer service: https://github.com/dartartem/eventuate-quarkus-examples-customers-and-orders/blob/master/orders-service/src/main/java/net/chrisrichardson/eventstore/examples/customersandorders/ordersservice/backend/CustomerServiceProxy.java

Micronaut version also uses it. RestTemplate is just a class, so why not use it?
Quarkus provides too complicated way to do similar things: https://quarkus.io/guides/rest-client

@cer
Copy link
Collaborator

cer commented Jan 29, 2021

A few issues:

  • RestTemplate is from the Spring ecosystem. The Quarkus ecosystem (and possibly the Micronaut ecosystem although that's partially in the Spring ecosystem) might have their own idiomatic HTTP clients. The services (not so concerned about the tests) should use them.
  • The RestTemplate is not a class that you can consume in isolation. It's packaged with a whole bunch of transitive dependencies (some of which created this issue). That's a lot of overhead for 'just a class'

@dartartem
Copy link
Contributor Author

@cer, ok then I will use quarkus http client

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

No branches or pull requests

2 participants