camel-quarkus: [Mandrel 23.0.0] google-bigquery integration test native compilation fails

Bug description

The initial CI fails seems to suggest there are some items that need reflective class configuration:

2023-06-21T13:20:25.2633284Z Caused by: java.lang.IllegalArgumentException: field private java.util.List com.google.api.services.bigquery.model.TableDataList.rows
2023-06-21T13:20:25.2633909Z 	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:900)
2023-06-21T13:20:25.2634647Z 	at com.google.api.client.json.JsonParser.parse(JsonParser.java:451)
2023-06-21T13:20:25.2635157Z 	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:787)
2023-06-21T13:20:25.2635519Z 	... 56 more
2023-06-21T13:20:25.2636002Z Caused by: java.lang.IllegalArgumentException: field private java.util.List com.google.api.services.bigquery.model.TableDataList.rows
2023-06-21T13:20:25.2636636Z 	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:900)
2023-06-21T13:20:25.2637148Z 	at com.google.api.client.json.JsonParser.parseArray(JsonParser.java:641)
2023-06-21T13:20:25.2637635Z 	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:744)
2023-06-21T13:20:25.2637990Z 	... 58 more
2023-06-21T13:20:25.2638495Z Caused by: java.lang.IllegalArgumentException: field private java.util.List com.google.api.services.bigquery.model.TableRow.f
2023-06-21T13:20:25.2639091Z 	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:900)
2023-06-21T13:20:25.2639697Z 	at com.google.api.client.json.JsonParser.parse(JsonParser.java:451)
2023-06-21T13:20:25.2640185Z 	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:787)
2023-06-21T13:20:25.2640541Z 	... 60 more
2023-06-21T13:20:25.2640987Z Caused by: java.lang.IllegalArgumentException: field private java.util.List com.google.api.services.bigquery.model.TableRow.f
2023-06-21T13:20:25.2641583Z 	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:900)
2023-06-21T13:20:25.2642090Z 	at com.google.api.client.json.JsonParser.parseArray(JsonParser.java:641)
2023-06-21T13:20:25.2642597Z 	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:744)
2023-06-21T13:20:25.2642932Z 	... 62 more
2023-06-21T13:20:25.2643475Z Caused by: java.lang.IllegalArgumentException: unable to create new instance of class com.google.api.services.bigquery.model.TableCell because it has no accessible default constructor
2023-06-21T13:20:25.2644200Z 	at com.google.api.client.util.Types.handleExceptionForNewInstance(Types.java:162)
2023-06-21T13:20:25.2644728Z 	at com.google.api.client.util.Types.newInstance(Types.java:117)
2023-06-21T13:20:25.2645196Z 	at com.google.api.client.util.Data.newMapInstance(Data.java:550)
2023-06-21T13:20:25.2645681Z 	at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:766)
2023-06-21T13:20:25.2646026Z 	... 64 more
2023-06-21T13:20:25.2646415Z Caused by: java.lang.InstantiationException: com.google.api.services.bigquery.model.TableCell
2023-06-21T13:20:25.2646918Z 	at java.base@17.0.7/java.lang.Class.newInstance(DynamicHub.java:639)
2023-06-21T13:20:25.2647359Z 	at com.google.api.client.util.Types.newInstance(Types.java:113)
2023-06-21T13:20:25.2647665Z 	... 66 more
2023-06-21T13:20:25.2648091Z Caused by: java.lang.NoSuchMethodException: com.google.api.services.bigquery.model.TableCell.<init>()
2023-06-21T13:20:25.2648610Z 	at java.base@17.0.7/java.lang.Class.checkMethod(DynamicHub.java:1038)
2023-06-21T13:20:25.2649031Z 	at java.base@17.0.7/java.lang.Class.getConstructor0(DynamicHub.java:1204)
2023-06-21T13:20:25.2649445Z 	at java.base@17.0.7/java.lang.Class.newInstance(DynamicHub.java:626)
2023-06-21T13:20:25.2649747Z 	... 67 more

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 40 (24 by maintainers)

Commits related to this issue

Most upvoted comments

@zakkak, I see that quarkus.native.additional-build-args is somehow not powerful enough to override the value present in gax-grpc jar. But it is still not clear to me why? Could you perhaps shed some light on that?

If you run native-image with --verbose you can see the options that end up being passed to the native image builder after combining options given by the user, the libraries, and the application. These options are passed in the following order:

  1. Options automatically passed by Quarkus
  2. User options passed through quarkus.native.additional-build-args (these can override the ones in 1)
  3. Options automatically passed by Quarkus that we don’t want to allow the users to override (see https://github.com/quarkusio/quarkus/blob/5382a3de02facc6f1be2f55d8fdb7d5c1fce8dc2/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java#L795-L799)
  4. Options passed through native-image.properties of dependencies
  5. Options passed through native-image.properties of the application

with each category being able to override the previous categories. So, since quarkus.native.additional-build-args are applied before the native-image.properties there is no way for them to override the values passed through native-image.properties. AFAIK there is no way to make command line options to apply after options defined in native-image.properties.

Thanks a lot for the informative answer, @zakkak!

@zakkak, I see that quarkus.native.additional-build-args is somehow not powerful enough to override the value present in gax-grpc jar. But it is still not clear to me why? Could you perhaps shed some light on that?

If you run native-image with --verbose you can see the options that end up being passed to the native image builder after combining options given by the user, the libraries, and the application. These options are passed in the following order:

  1. Options automatically passed by Quarkus
  2. User options passed through quarkus.native.additional-build-args (these can override the ones in 1)
  3. Options automatically passed by Quarkus that we don’t want to allow the users to override (see https://github.com/quarkusio/quarkus/blob/5382a3de02facc6f1be2f55d8fdb7d5c1fce8dc2/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java#L795-L799)
  4. Options passed through native-image.properties of dependencies
  5. Options passed through native-image.properties of the application

with each category being able to override the previous categories. So, since quarkus.native.additional-build-args are applied before the native-image.properties there is no way for them to override the values passed through native-image.properties. AFAIK there is no way to make command line options to apply after options defined in native-image.properties.

HTH

I think there might be something wrong during the graal perform static analysis.

The error about undefined reference to 'Java_com_sun_management_internal_OperatingSystemImpl_initialize0' looks related to this commit

The OPERATING_SYSTEM_IMPL class is not reachable but actually it is. Then sometimes we get the native image build successful and sometimes not. I have no any idea about how the static analysis work here. @zakkak any hint?