Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

copybara-service[bot]
Copy link
Contributor

@copybara-service copybara-service bot commented Mar 7, 2025

feat: [vertexai] Update GAPIC library to include new features

@copybara-service copybara-service bot requested review from a team as code owners March 7, 2025 01:23
@copybara-service copybara-service bot force-pushed the copybara_734345919 branch 3 times, most recently from 7c4175c to 3665396 Compare March 10, 2025 16:02
@copybara-service copybara-service bot changed the title feat: Update GAPIC library to include new features feat: [vertexai] Update GAPIC library to include new features Mar 10, 2025
Copy link
Contributor

@jaycee-li jaycee-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internally approved

@suztomo
Copy link
Member

suztomo commented Mar 13, 2025

[1/8] Initializing...                                                                                    (6.1s @ 0.31GB)
 Java version: 23.0.2+7, vendor version: GraalVM CE 23.0.2+7.1
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: gcc (redhat, x86_64, 11.5.0)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 5 user-specific feature(s):
 - com.google.api.gax.grpc.nativeimage.GrpcNettyFeature
 - com.google.api.gax.nativeimage.GoogleJsonClientFeature
 - com.google.api.gax.nativeimage.OpenCensusFeature
 - com.oracle.svm.thirdparty.gson.GsonFeature
 - org.graalvm.junit.platform.JUnitPlatformFeature
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 10.67GB of memory (34.0% of 31.41GB system memory, determined at start)
 - 8 thread(s) (100.0% of 8 available processor(s), determined at start)
Mar 12, 2025 9:59:44 PM com.google.api.gax.nativeimage.NativeImageUtils registerClassForReflection
WARNING: Failed to find io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators on the classpath for reflection.
[junit-platform-native] Running in 'test listener' mode using files matching pattern [junit-platform-unique-ids*] found in folder [/tmpfs/src/github/google-cloud-java/java-vertexai/google-cloud-vertexai/target/test-ids] and its subfolders.
[2/8] Performing analysis...  []                                                                        (34.6s @ 2.04GB)
   14,018 reachable types   (82.0% of   17,092 total)
   24,711 reachable fields  (54.4% of   45,461 total)
  105,634 reachable methods (64.8% of  163,016 total)
    5,460 types,   202 fields, and 1,594 methods registered for reflection

Fatal error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: An object of type 'jdk.proxy4.$Proxy69' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.

You now have two options to resolve this:

1) If it is intended that objects of type 'jdk.proxy4.$Proxy69' are persisted in the image heap, add 

    '--initialize-at-build-time=org.junit.runner.RunWith,java.lang.annotation.Annotation'

to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of [org.junit.runner.RunWith, java.lang.annotation.Annotation] to see if they are safe for build-time initialization,  and that they do not contain any sensitive data that should not become part of the image.

2) If these objects should not be stored in the image heap, please try to infer from the source code how the culprit object got instantiated.

If you are seeing this message after upgrading to a new GraalVM release, this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=org.junit.runner.RunWith,java.lang.annotation.Annotation' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.

The following detailed trace displays from which field in the code the object was reached.
Object was reached by
  indexing into array java.lang.annotation.Annotation[]@9450204: [Ljava.lang.annotation.Annotation;@9450204 at index 0
  reading field org.junit.runner.Description.fAnnotations of constant 
    org.junit.runner.Description@61634c9d: com.google.cloud.vertexai.it.ITChatSessionIntegrationTest
  reading field org.junit.vintage.engine.descriptor.VintageTestDescriptor.description of constant 
    org.junit.vintage.engine.descriptor.RunnerTestDescriptor@7539bb6b: RunnerTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai.i...
  reading field java.util.HashMap$Node.key of constant 
    java.util.LinkedHashMap$Entry@718b1246: RunnerTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai.i...
  reading field java.util.LinkedHashMap$Entry.before of constant 
    java.util.LinkedHashMap$Entry@6fd475eb: RunnerTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai.i...
  reading field java.util.LinkedHashMap.tail of constant 
    java.util.LinkedHashMap@3a4473c5: {RunnerTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai....
  reading field java.util.HashSet.map of constant 
    java.util.LinkedHashSet@27f7e8a9: [RunnerTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai....
  reading field java.util.Collections$SynchronizedCollection.c of constant 
    java.util.Collections$SynchronizedSet@24e73933: [RunnerTestDescriptor: [engine:junit-vintage]/[runner:com.google.cloud.vertexai....
  reading field org.junit.platform.engine.support.descriptor.AbstractTestDescriptor.children of constant 
    org.junit.vintage.engine.descriptor.VintageEngineDescriptor@20dd67ce: VintageEngineDescriptor: [engine:junit-vintage]
  reading field java.util.HashMap$Node.value of constant 
    java.util.LinkedHashMap$Entry@44114b3b: org.junit.vintage.engine.VintageTestEngine@7ffcb232=VintageEngineDescriptor: [en...
  reading field java.util.LinkedHashMap.head of constant 
    java.util.LinkedHashMap@8ad33f8: {org.junit.vintage.engine.VintageTestEngine@7ffcb232=VintageEngineDescriptor: [e...
  reading field java.util.Collections$UnmodifiableMap.m of constant 
    java.util.Collections$UnmodifiableMap@193de9f0: {org.junit.vintage.engine.VintageTestEngine@7ffcb232=VintageEngineDescriptor: [e...
  reading field org.junit.platform.launcher.core.LauncherDiscoveryResult.testEngineDescriptors of constant 
    org.junit.platform.launcher.core.LauncherDiscoveryResult@2a61ce93: org.junit.platform.launcher.core.LauncherDiscoveryResult@2a61ce93
  reading field org.junit.platform.launcher.core.InternalTestPlan.discoveryResult of constant 
    org.junit.platform.launcher.core.InternalTestPlan@2e681cea: org.junit.platform.launcher.core.InternalTestPlan@2e681cea
  scanning root org.junit.platform.launcher.core.InternalTestPlan@2e681cea: org.junit.platform.launcher.core.InternalTestPlan@2e681cea embedded in
    
  at org.graalvm.junit.platform.NativeImageJUnitLauncher.main(String[]) [bci: -5]
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.onObjectReachable(ImageHeapScanner.java:591)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.heap.SVMImageHeapScanner.onObjectReachable(SVMImageHeapScanner.java:125)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$markReachable$10(ImageHeapScanner.java:572)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:166)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:152)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1726)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1717)
	at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1641)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1460)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2036)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:189)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: An object of type 'jdk.proxy4.$Proxy69' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
`

@suztomo suztomo merged commit 4ebc716 into main Mar 17, 2025
30 of 31 checks passed
@suztomo suztomo deleted the copybara_734345919 branch March 17, 2025 19:07
lqiu96 pushed a commit that referenced this pull request Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants