GoogleCloudPlatform / service-broker-samples

Apache License 2.0
12 stars 6 forks source link

Recommendations for Store Locator instructions #18

Open dfoleypivotal opened 5 years ago

dfoleypivotal commented 5 years ago

Below are some issues that I encountered while deploying application.

Used the following command mvn package -DskipTests=true instead of mvn package to get the JAR file created.

cf service storelocator should be changed to cf service storelocator-spanner

Application should first be deployed with --no-start flag before binding to service. Once bind is done you can use cf start storelocator.

Deployment of application is failing. Below is error that I am receiving.

2018-11-03T08:24:17.446-06:00 [APP/PROC/WEB/0] [OUT] 2018-11-03 14:24:17.446 WARN 13 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'databaseInitializer' defined in file [/home/vcap/app/BOOT-INF/classes/com/google/cloud/servicebroker/samples/storelocator/DatabaseInitializer.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storeRepository': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/query/QueryMethodEvaluationContextProvider
2018-11-03T08:24:17.486-06:00 [APP/PROC/WEB/0] [OUT] 2018-11-03 14:24:17.485 INFO 13 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2018-11-03T08:24:17.531-06:00 [APP/PROC/WEB/0] [OUT] 2018-11-03 14:24:17.530 INFO 13 --- [ main] ConditionEvaluationReportLoggingListener :
2018-11-03T08:24:17.531-06:00 [APP/PROC/WEB/0] [OUT] Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] 2018-11-03 14:24:17.543 ERROR 13 --- [ main] o.s.boot.SpringApplication : Application run failed
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'databaseInitializer' defined in file [/home/vcap/app/BOOT-INF/classes/com/google/cloud/servicebroker/samples/storelocator/DatabaseInitializer.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storeRepository': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/query/QueryMethodEvaluationContextProvider
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:732) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:197) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1267) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1124) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.4.RELEASE.jar!/:2.0.4.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-2.0.4.RELEASE.jar!/:2.0.4.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:398) [spring-boot-2.0.4.RELEASE.jar!/:2.0.4.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) [spring-boot-2.0.4.RELEASE.jar!/:2.0.4.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258) [spring-boot-2.0.4.RELEASE.jar!/:2.0.4.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.4.RELEASE.jar!/:2.0.4.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at com.google.cloud.servicebroker.samples.storelocator.StoreLocatorApplication.main(StoreLocatorApplication.java:26) [classes/:na]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_172]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_172]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_172]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_172]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [app/:na]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [app/:na]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [app/:na]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [app/:na]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storeRepository': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/query/QueryMethodEvaluationContextProvider
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1135) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:818) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:724) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] ... 27 common frames omitted
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] Caused by: java.lang.NoClassDefFoundError: org/springframework/data/repository/query/QueryMethodEvaluationContextProvider
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.cloud.gcp.data.spanner.repository.support.SpannerRepositoryFactoryBean.createRepositoryFactory(SpannerRepositoryFactoryBean.java:64) ~[spring-cloud-gcp-data-spanner-1.1.0.M2.jar!/:1.1.0.M2]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:264) ~[spring-data-commons-2.0.9.RELEASE.jar!/:2.0.9.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1758) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1695) ~[spring-beans-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] ... 38 common frames omitted
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] Caused by: java.lang.ClassNotFoundException: org.springframework.data.repository.query.QueryMethodEvaluationContextProvider
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_172]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_172]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93) ~[app/:na]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_172]
2018-11-03T08:24:17.544-06:00 [APP/PROC/WEB/0] [OUT] ... 42 common frames omitted
2018-11-03T08:24:18.836-06:00 [APP/PROC/WEB/0] [OUT] Exit status 1
mattysweeps commented 5 years ago

@dfoleypivotal Thanks for reporting this.

About the starting bug: I believe I also ran into this at the CF EU Summit and never merged my changes.

Let me find those commits and verify they're good.

mattysweeps commented 5 years ago

@dfoleypivotal Are you experiencing any of these issues anymore?

dfoleypivotal commented 5 years ago

Looking at the instructions they still need to be modified. If you follow the other examples that should work.