You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a job property defined as an enum named BatchMode
@BatchProperty(name = "batchMode") BatchMode batchMode
I get an injection error
Caused by: 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: jakarta.enterprise.inject.spi.DeploymentException: jakarta.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type com.mycompany.myapp.batch.BatchMode and qualifiers [@BatchProperty(name = "batchMode")]
declared on CLASS bean [types=[jakarta.batch.api.chunk.ItemReader, com.mycompany.myapp.batch.DqlItemReader<com.mycompany.myapp.model.User>, jakarta.batch.api.chunk.AbstractItemReader, com.mycompany.myapp.batch.user.UserDqlReader, java.lang.Object], qualifiers=[@default, @Any, @nAmed("UserDqlReader")], target=com.mycompany.myapp.batch.user.UserDqlReader]
at io.quarkus.arc.processor.BeanDeployment.procerrors(BeanDeployment.java:1435)
at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:310)
at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:155)
at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:469)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:864)
at io.quarkus.builder.BuildContext.run(BuildContext.java:282)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at java.base/java.lang.Thread.run(Thread.java:833)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: jakarta.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type com.mycompany.myapp.batch.BatchMode and qualifiers [@BatchProperty(name = "batchMode")]
declared on CLASS bean [types=[jakarta.batch.api.chunk.ItemReader, com.mycompany.myapp.batch.DqlItemReader<com.mycompany.myapp.model.User>, jakarta.batch.api.chunk.AbstractItemReader, com.mycompany.myapp.batch.user.UserDqlReader, java.lang.Object], qualifiers=[@default, @Any, @nAmed("UserDqlReader")], target=com.mycompany.myapp.batch.user.UserDqlReader]
at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:477)
at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:624)
at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:298)
... 13 more
Even if it's not described in the Jakarta Batch 2.1 Spec, there is a ValueConverter in JBeret which should be able to do the String to Enum conversion: https://github.com/jberet/jsr352/blob/main/jberet-core/src/main/java/org/jberet/creation/ValueConverter.java
I'm tempted to contribute in JBeret but I'm stuck here (https://stackoverflow.com/questions/78537939/generic-enum-bean-producer).
In the linked discussion above there is a possible solution on Quarkus extension side but requires some modification on JBeret code in BatchBeanProducer.
If someone can give me some advices to point me in the right direction I'll be happy to contribute.
The text was updated successfully, but these errors were encountered:
This is a quote from Quarkus JBeret extension from this issue (quarkiverse/quarkus-jberet#243)
I'm tempted to contribute in JBeret but I'm stuck here (https://stackoverflow.com/questions/78537939/generic-enum-bean-producer).
In the linked discussion above there is a possible solution on Quarkus extension side but requires some modification on JBeret code in BatchBeanProducer.
If someone can give me some advices to point me in the right direction I'll be happy to contribute.
The text was updated successfully, but these errors were encountered: