1
votes

I am building a modular project using quarkus. This project is composed of two API modules and on commons module. My idea is o have all repositories into the common module to access them in both APIs. When I try to create a repository into the common module the other modules can not load them. I am getting:

[error]: Build step io.quarkus.hibernate.validator.deployment.HibernateValidatorProcessor#build threw an exception: java.lang.NullPointerException;

The common module already uses Jandex plugin.

Please check: https://github.com/sousadax12/quarkus-modules-test/tree/master

1
We need a lot more information to be able to help you. Could you at least provide the full NPE stacktrace? And if possible, provide a reproducer? It certainly looks like a bug so better create an issue in our GitHub tracker with as much information as possible and we will have a look. - Guillaume Smet
@GuillaumeSmet i create a simple github project where got the error. github.com/sousadax12/quarkus-modules-test/tree/master - Sousadax

1 Answers

0
votes

When I ran the api-one with quarkus:dev I got

Caused by: java.lang.ClassCastException: com.airhacks.full.boundary.TestRepository_ClientProxy cannot be cast to com.airhacks.full.boundary.TestRepository

but in theory it should work. because after all this is java. so after mvn install I ran it from command line with

PS D:\tmp\quarkus-modules-test\api-one> java -jar .\target\api-one-1.0-SNAPSHOT-runner.jar
2019-12-13 16:35:09,690 WARN  [io.qua.jae.run.JaegerDeploymentRecorder] (main) Jaeger service name has not been defined, either as 'quarkus.jaeger.service-name' application property or JAEGER_SERVICE_NAME environment variable/system property
2019-12-13 16:35:10,660 WARN  [io.qua.sch.run.QuartzScheduler] (main) No @Scheduled methods found, scheduler will not be started.
2019-12-13 16:35:10,674 INFO  [io.quarkus] (main) api-one 1.0-SNAPSHOT (running on Quarkus 0.25.0) started in 2.739s. Listening on: http://0.0.0.0:8080
2019-12-13 16:35:10,675 INFO  [io.quarkus] (main) Profile prod activated.
2019-12-13 16:35:10,680 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, hibernate-validator, jaeger, jdbc-h2, narayana-jta, resteasy, resteasy-jsonb, scheduler, security, servlet, smallrye-context-propagation, smallrye-fault-tolerance, smallrye-health, smallrye-metrics, smallrye-openapi, smallrye-opentracing, undertow-websockets]

I also added just one testentity to make sure. here is the output

[{"name":"name"}]

in browser api-one response to ping

So in my opinion quarkus:dev is nice feature but its not handling multi-modules well yet. so stick with the java run.

You can find running example here https://github.com/ozkanpakdil/quarkus-modules-test btw thanks for reproducer. I really appreciated.