Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Datastore sample test debug #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

chore: Datastore sample test debug #4

wants to merge 2 commits into from

Conversation

zhumin8
Copy link
Collaborator

@zhumin8 zhumin8 commented May 15, 2023

This PR is for temp debug use. Not intend to merge.

Setup for datastore sample for native compile.
With native profile, build success. Get runtime error:


2023-05-15T15:30:37.017-04:00  WARN 72295 --- [           main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookController': Unsatisfied dependency expressed through constructor parameter 0: No qualifying bean of type 'com.example.BookRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2023-05-15T15:30:37.019-04:00 ERROR 72295 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of constructor in com.example.BookController required a bean of type 'com.example.BookRepository' that could not be found.


Action:

Consider defining a bean of type 'com.example.BookRepository' in your configuration

Then Try use tracing agent:

  • Comment out @EnabledIfSystemProperty(named = "it.datastore", matches = "true") from test
  • Confirm gcloud auth project w/ appropriate settings- set it with application.properties to by-pass project-id issue with cloud-top.
  • runmvn verify -DargLine="-agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image"

Get Build error

Fatal error: java.lang.NullPointerException: Cannot invoke "jdk.vm.ci.meta.JavaField.format(String)" because "field" is null

Apply workaround, build success

Get first runtime error again.

Parameter 0 of constructor in com.example.BookController required a bean of type 'com.example.BookRepository' that could not be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant