gpt4 book ai didi

jooq - 是否可以将 jOOQ 与 Quarkus 一起使用?

转载 作者:行者123 更新时间:2023-12-03 20:57:01 26 4
gpt4 key购买 nike

我很好奇 jOOQ 是否可以与 Quarkus 一起工作,所以我创建了一个 Gradle 项目。我收到此构建错误:

Caused by: io.quarkus.creator.AppCreatorException: Failed to augment application classes
at io.quarkus.creator.phase.augment.AugmentTask.run(AugmentTask.java:188)
at io.quarkus.creator.phase.augment.AugmentTask.run(AugmentTask.java:53)
at io.quarkus.creator.CuratedApplicationCreator.runTask(CuratedApplicationCreator.java:139)
at io.quarkus.gradle.tasks.QuarkusBuild.buildQuarkus(QuarkusBuild.java:91)
... 92 more
Caused by: 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 org.jooq.DSLContext and qualifiers [@Default]
- java member: com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter#<init>()
- declared on CLASS bean [types=[com.hexarchbootdemo.application.port.output.persistence.FindVoterPort, com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter, com.hexarchbootdemo.application.port.output.persistence.RegisterVoterPort, java.lang.Object], qualifiers=[@Named(value = "voterPersistenceH2Adapter"), @Default, @Any], target=com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter]
at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:879)
at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:231)
at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:117)
at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:272)
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:915)
at io.quarkus.builder.BuildContext.run(BuildContext.java:279)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
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 org.jooq.DSLContext and qualifiers [@Default]
- java member: com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter#<init>()
- declared on CLASS bean [types=[com.hexarchbootdemo.application.port.output.persistence.FindVoterPort, com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter, com.hexarchbootdemo.application.port.output.persistence.RegisterVoterPort, java.lang.Object], qualifiers=[@Named(value = "voterPersistenceH2Adapter"), @Default, @Any], target=com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter]

我尝试将 DI 提示( https://quarkus.io/guides/cdi-reference )添加到 application.properties,但没有任何区别。
quarkus.index-dependency.jooq.group-id=org.jooq
quarkus.index-dependency.jooq.artifact-id=jooq

存在 jOOQ 依赖项:
compileClasspath - Compile classpath for compilation 'main' (target  (jvm)).
+--- org.springframework.boot:spring-boot-starter-jooq:2.2.3.RELEASE
| +--- org.springframework.boot:spring-boot-starter-jdbc:2.2.3.RELEASE
...
...
| \--- **org.jooq:jooq:3.12.3**

是否可以使用 jOOQ 和 Quarkus?

最佳答案

我发现这个 repo 有一个使用 jOOQ 和 Quarkus 的例子,它让我克服了上述错误:https://github.com/jean-merelis/jOOQ-mcve .

我所做的更改是:

  • 添加了一个类似于 https://github.com/jean-merelis/jOOQ-mcve/blob/master/src/main/java/org/jooq/mcve/JooqContextProducer.java 的类
  • 添加了类似的配置文件,如 https://github.com/jean-merelis/jOOQ-mcve/blob/master/src/main/resources/reflection-config.json
  • 关于jooq - 是否可以将 jOOQ 与 Quarkus 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60476163/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com