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
Describe the bug
An indexing error with an unhelpful error message is displayed if you add a generated class
as an additional bean at build message
Expected behavior
An error message that suggests to use GeneratedBeanGizmoAdaptor .
Ex: "Unable to find class file for ${className}. Maybe ${className} was registered as an additional bean via AdditionalBeanBuildItem. In that case, remove the producer of AdditionalBeanBuildItem and use a GeneratedBeanGizmoAdaptor as the class output for ClassCreator."
Actual behavior
An unhelpful "java.lang.IllegalArgumentException: stream cannot be null" is shown
java.lang.IllegalArgumentException: stream cannot be null
[ERROR] at org.jboss.jandex.Indexer.index(Indexer.java:1584)
[ERROR] at io.quarkus.deployment.index.IndexingUtil.indexClass(IndexingUtil.java:32)
[ERROR] at io.quarkus.arc.deployment.BeanArchiveProcessor.build(BeanArchiveProcessor.java:73)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Ok, so I've tried to reproduce the problem and I can see the same error in 2.15.0. You're right that in this case, the best thing to do is to use the GeneratedBeanBuildItem or GeneratedBeanGizmoAdaptor.
I'm not sure if we could detect this special case easily. However, we should definitely improve the javadoc of AdditionalBeanBuildItem and make it clear that it should not be used for generated classes.
Describe the bug
An indexing error with an unhelpful error message is displayed if you add a generated class
as an additional bean at build message
Expected behavior
An error message that suggests to use GeneratedBeanGizmoAdaptor .
Ex: "Unable to find class file for ${className}. Maybe ${className} was registered as an additional bean via
AdditionalBeanBuildItem
. In that case, remove the producer ofAdditionalBeanBuildItem
and use a GeneratedBeanGizmoAdaptor as the class output for ClassCreator."Actual behavior
An unhelpful "java.lang.IllegalArgumentException: stream cannot be null" is shown
To Reproduce
https://github.com/Christopher-Chianelli/issue-reproducer/tree/gizmo-cannot-be-indexed-error
mvn clean install
; the error will occur during the build of the example project.Configuration
# Add your application.properties here, if applicable.
Screenshots
(If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
uname -a
orver
:java -version
:mvnw --version
orgradlew --version
):Additional context
(Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered: