Open PetoMichalak opened 12 months ago
The problem is likely that classes under the javax.
package need to be moved to jakarta.
We have had a bit of a breakthrough. A change was made, I wish I know that, which means that quarkus-arc now indications the cause of the issue:
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:3.5.2:build (default) on project quarkus-djl-example: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.arc.deployment.ArcProcessor#registerBeans threw an exception: jakarta.enterprise.inject.spi.DefinitionException: Producer method ai.djl.inference.Predictor<? extends java.lang.Object, ? extends java.lang.Object> predictor() declared on class ai.djl.quarkus.runtime.DjlPredictorProducer contains a parameterized type with a wildcard. This type is not a legal bean type according to CDI specification.
[ERROR] at io.quarkus.arc.processor.Types.containsWildcard(Types.java:579)
[ERROR] at io.quarkus.arc.processor.Types.getTypeClosure(Types.java:623)
[ERROR] at io.quarkus.arc.processor.Types.getTypeClosure(Types.java:683)
[ERROR] at io.quarkus.arc.processor.Types.getProducerMethodTypeClosure(Types.java:439)
[ERROR] at io.quarkus.arc.processor.BeanDeployment.findBeans(BeanDeployment.java:1209)
[ERROR] at io.quarkus.arc.processor.BeanDeployment.registerBeans(BeanDeployment.java:272)
So we need to restructure DjlPredictorProducer into a legal bean type according to CDI specification.
@ApplicationScoped
public class DjlPredictorProducer {
private volatile ZooModel<?, ?> model;
void initialize(ZooModel<?, ?> model) {
this.model = model;
}
@Produces
public ZooModel<?, ?> model() {
return model;
}
@Produces
public Predictor<?, ?> predictor() {
return model.newPredictor();
}
}
Describe the bug
Hello, We have been attempting to update the support for Quarkus in Deep Java Library (DJL), a package which provides an engine-agnostic Java framework for deep learning. The 'djl-demo' package (https://github.com/deepjavalibrary/djl-demo/blob/master/quarkus/example/README.md contains a Quarkus Extension for DJL, plus demo of deep java learning utilizing the Extension, but is based on a rather old Quarkus, 1.13.0.Final. We have been attempting to update the demo to the latest versions of DJL (0.24.0) and Quarkus 3.5.1. But it appears there has been a change in how the DJL's Quarkus Extension now needs to accomplish Dependency and Context injection of the DjlPredictorProducer Bean, the basis of the integration.
Are there any particular issues which need to be addressed when updating old Quarkus Extensions, from around 1.13.0.Final, to Quarkus 3.5.1?
Expected behavior
mvn clean install
runs greenActual behavior
How to Reproduce?
mvn clean install
Output of
uname -a
orver
Darwin nicd 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "17.0.8" 2023-07-18 OpenJDK Runtime Environment Temurin-17.0.8+7 (build 17.0.8+7) OpenJDK 64-Bit Server VM Temurin-17.0.8+7 (build 17.0.8+7, mixed mode, sharing)
Quarkus version or git rev
3.5.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response