Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

DataTaz avatar image
DataTaz asked Cedrick Lunven answered

Cannot run the Microservices with Spring Data + Stargate.io workshop, getting FileNotFoundException for the secure bundle

When doing the "Build Microservices with Spring Data, Cassandra, and Stargate.io" workshop, the application won't launch and the tests won't run correctly. Tried this in different instances of Gitpod. Tried this from different systems. Tried this locally and got the exact same messages back. Any guidance would be great!?

https://github.com/datastaxdevs/workshop-spring-stargate

gitpod /workspace/workshop-spring-stargate/stargate-demo $ mvn spring-boot:run
Picked up JAVA_TOOL_OPTIONS: -Xmx2576m
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.datastax:stargate-demo >---------------------
[INFO] Building stargate-demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.5.1:run (default-cli) > test-compile @ stargate-demo >>>
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ stargate-demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 98 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ stargate-demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ stargate-demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /workspace/workshop-spring-stargate/stargate-demo/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ stargate-demo ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /workspace/workshop-spring-stargate/stargate-demo/target/test-classes
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.5.1:run (default-cli) < test-compile @ stargate-demo <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.5.1:run (default-cli) @ stargate-demo ---
[INFO] Attaching agents: []
Picked up JAVA_TOOL_OPTIONS: -Xmx2576m
_________ __ __
/ _____// |______ _______ _________ _/ |_ ____
\_____ \\ __\__ \\_ __ \/ ___\__ \\ __\/ __ \
/ \| | / __ \| | \/ /_/ > __ \| | \ ___/
/_______ /|__| (____ /__| \___ (____ /__| \___ >
\/ \/ /_____/ \/ \/
________
\______ \ ____ _____ ____
| | \_/ __ \ / \ / _ \
| ` \ ___/| Y Y ( <_> )
/_______ /\___ >__|_| /\____/
\/ \/ \/


DataStax Developer Advocate team


22:24:07.725 INFO com.datastax.demo.stargate.StargateDemoApplication : Starting StargateDemoApplication using Java 11.0.13 on ws-389a968c-730b-471e-923e-37b637671770 with PID 1408 (/workspace/workshop-spring-stargate/stargate-demo/target/classes started by gitpod in /workspace/workshop-spring-stargate/stargate-demo)
22:24:07.729 INFO com.datastax.demo.stargate.StargateDemoApplication : No active profile set, falling back to default profiles: default
22:24:09.401 INFO com.datastax.astra.sdk.AstraClient : Initializing [AstraClient]
22:24:09.402 INFO com.datastax.astra.sdk.AstraClient : + Load Environment Variables
22:24:09.403 INFO com.datastax.astra.sdk.AstraClient : + Load Builder parameters
22:24:09.559 INFO com.datastax.stargate.sdk.utils.HttpApisClient : + HttpClient Initialized
22:24:09.562 INFO com.datastax.astra.sdk.AstraClient : + API(s) Devops is [ENABLED]
22:24:09.562 INFO com.datastax.astra.sdk.AstraClient : + Creating folder .astra
22:24:09.562 INFO com.datastax.astra.sdk.AstraClient : + Downloading secureBundle for db 'f3e183d9-fb1c-415a-abfb-a1d5f4ce6373-1'
22:24:10.418 WARN com.datastax.astra.sdk.databases.DatabaseClient : DB f3e183d9-fb1c-415a-abfb-a1d5f4ce6373-1 is not active, no download
22:24:10.418 INFO com.datastax.astra.sdk.AstraClient : + Load Secure Connect: /home/gitpod/.astra/secure_connect_bundle_f3e183d9-fb1c-415a-abfb-a1d5f4ce6373-1.zip
22:24:10.418 INFO com.datastax.astra.sdk.AstraClient : + CQL Credentials: ${clientId}${/clientSecret}
22:24:10.420 INFO com.datastax.stargate.sdk.StargateClient : Initializing [StargateClient]
22:24:10.422 INFO com.datastax.stargate.sdk.doc.ApiDocumentClient : + API(s) Document is [ENABLED] https://f3e183d9-fb1c-415a-abfb-a1d5f4ce6373-1-eastus2.apps.astra.datastax.com/api/rest
22:24:10.423 INFO com.datastax.stargate.sdk.rest.ApiDataClient : + API(s) REST Data is [ENABLED] https://f3e183d9-fb1c-415a-abfb-a1d5f4ce6373-1-eastus2.apps.astra.datastax.com/api/rest
22:24:10.424 INFO com.datastax.stargate.sdk.gql.ApiGraphQLClient : + API(s) GraphQL [ENABLED] https://f3e183d9-fb1c-415a-abfb-a1d5f4ce6373-1-eastus2.apps.astra.datastax.com/api/graphql
22:24:10.538 WARN org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'chevronRestController' defined in file [/workspace/workshop-spring-stargate/stargate-demo/target/classes/com/datastax/demo/stargate/chevrons/ChevronRestController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'chevronRepository' defined in com.datastax.demo.stargate.chevrons.ChevronRepository defined in @EnableCassandraRepositories declared on CassandraRepositoriesRegistrar.EnableCassandraRepositoriesConfiguration: Cannot resolve reference to bean 'cassandraTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cqlSession' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Unsatisfied dependency expressed through method 'cqlSession' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'astraClient' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.astra.sdk.AstraClient]: Factory method 'astraClient' threw exception; nested exception is com.datastax.oss.driver.api.core.DriverExecutionException
22:24:10.574 ERROR org.springframework.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'chevronRestController' defined in file [/workspace/workshop-spring-stargate/stargate-demo/target/classes/com/datastax/demo/stargate/chevrons/ChevronRestController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'chevronRepository' defined in com.datastax.demo.stargate.chevrons.ChevronRepository defined in @EnableCassandraRepositories declared on CassandraRepositoriesRegistrar.EnableCassandraRepositoriesConfiguration: Cannot resolve reference to bean 'cassandraTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cqlSession' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Unsatisfied dependency expressed through method 'cqlSession' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'astraClient' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.astra.sdk.AstraClient]: Factory method 'astraClient' threw exception; nested exception is com.datastax.oss.driver.api.core.DriverExecutionException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
at com.datastax.demo.stargate.StargateDemoApplication.main(StargateDemoApplication.java:10)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'chevronRepository' defined in com.datastax.demo.stargate.chevrons.ChevronRepository defined in @EnableCassandraRepositories declared on CassandraRepositoriesRegistrar.EnableCassandraRepositoriesConfiguration: Cannot resolve reference to bean 'cassandraTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cqlSession' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Unsatisfied dependency expressed through method 'cqlSession' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'astraClient' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.astra.sdk.AstraClient]: Factory method 'astraClient' threw exception; nested exception is com.datastax.oss.driver.api.core.DriverExecutionException
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:342)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:113)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1689)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1434)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 24 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cqlSession' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Unsatisfied dependency expressed through method 'cqlSession' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'astraClient' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.astra.sdk.AstraClient]: Factory method 'astraClient' threw exception; nested exception is com.datastax.oss.driver.api.core.DriverExecutionException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:410)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:330)
... 38 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cqlSession' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Unsatisfied dependency expressed through method 'cqlSession' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'astraClient' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.astra.sdk.AstraClient]: Factory method 'astraClient' threw exception; nested exception is com.datastax.oss.driver.api.core.DriverExecutionException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 57 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'astraClient' defined in class path resource [com/datastax/astra/boot/autoconfigure/AstraConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.astra.sdk.AstraClient]: Factory method 'astraClient' threw exception; nested exception is com.datastax.oss.driver.api.core.DriverExecutionException
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 71 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.datastax.astra.sdk.AstraClient]: Factory method 'astraClient' threw exception; nested exception is com.datastax.oss.driver.api.core.DriverExecutionException
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 85 common frames omitted
Caused by: com.datastax.oss.driver.api.core.DriverExecutionException: null
at com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:152)
at com.datastax.oss.driver.api.core.session.SessionBuilder.build(SessionBuilder.java:773)
at com.datastax.stargate.sdk.StargateClient.<init>(StargateClient.java:175)
at com.datastax.stargate.sdk.StargateClient.<init>(StargateClient.java:53)
at com.datastax.stargate.sdk.StargateClient$StargateClientBuilder.build(StargateClient.java:364)
at com.datastax.astra.sdk.AstraClient.<init>(AstraClient.java:203)
at com.datastax.astra.sdk.AstraClient.<init>(AstraClient.java:46)
at com.datastax.astra.sdk.AstraClient$AstraClientBuilder.build(AstraClient.java:510)
at com.datastax.astra.boot.autoconfigure.AstraConfiguration.astraClient(AstraConfiguration.java:91)
at com.datastax.astra.boot.autoconfigure.AstraConfiguration$$EnhancerBySpringCGLIB$$99ce9c2a.CGLIB$astraClient$1(<generated>)
at com.datastax.astra.boot.autoconfigure.AstraConfiguration$$EnhancerBySpringCGLIB$$99ce9c2a$$FastClassBySpringCGLIB$$94fc18f8.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
at com.datastax.astra.boot.autoconfigure.AstraConfiguration$$EnhancerBySpringCGLIB$$99ce9c2a.astraClient(<generated>)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 86 common frames omitted
Caused by: java.io.FileNotFoundException: /home/gitpod/.astra/secure_connect_bundle_f3e183d9-fb1c-415a-abfb-a1d5f4ce6373-1.zip (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184)
at java.base/java.net.URL.openStream(URL.java:1165)
at com.datastax.oss.driver.api.core.session.SessionBuilder.buildDefaultSessionAsync(SessionBuilder.java:814)
at com.datastax.oss.driver.api.core.session.SessionBuilder.buildAsync(SessionBuilder.java:755)
... 104 common frames omitted
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.291 s
[INFO] Finished at: 2021-12-06T22:24:10Z
[INFO] ------------------------------------------------------------------------
gitpod /workspace/workshop-spring-stargate/stargate-demo $
developer workshop
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Cedrick Lunven avatar image
Cedrick Lunven answered

Hi,

Thank you for your question. Let me provide you some context here.

Cloud Secure Bundle

To connect the Java drivers to Astra you need a zip file that contains some SSL certificates called a secure connect bundle.

In this workshop your are using the Astra SDK that does all the heavy lifting for you (downloading the file, configuring the drivers). The expected filename is `secure_connect_bundle_yourdbid.zip` in a temporary folder here `/home/gitpod/,astra`.

But for this to work you need to provide a valid database id and this is actually your error.

Fix your issue

In your application.yaml file you probably enter the datacenter ID instead of the database id. You probably entered instead of `f3e183d9-fb1c-415a-abfb-a1d5f4ce6373`. Notice how the datacenter Id is created with `dbid-1`.

  1. Replace `f3e183d9-fb1c-415a-abfb-a1d5f4ce6373-1` with `f3e183d9-fb1c-415a-abfb-a1d5f4ce6373` in `application.yam`
  2. Restart the application and you should be good to go


Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.