简体   繁体   中英

Accessing Data in Pivotal GemFire Lucene Analyzer not found

I'm following https://spring.io/guides/gs/accessing-data-gemfire/ . I cloned it, did a mvn package , then java -jar target/gs-accessing-data-gemfire-0.1.0.jar and got this stack trace:

[info 2018/07/15 21:55:04.676 BST <main> tid=0x1] Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@76f2b07d: startup date [Sun Jul 15 21:55:04 BST 2018]; root of context hierarchy

[error 2018/07/15 21:55:06.347 BST <main> tid=0x1] java.util.ServiceConfigurationError: org.apache.geode.internal.cache.CacheService: Provider org.apache.geode.cache.lucene.internal.LuceneServiceImpl could not be instantiated

[error 2018/07/15 21:55:06.410 BST <main> tid=0x1] Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'run' defined in hello.Application: Unsatisfied dependency expressed through method 'run' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personRepository': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'People': Cannot resolve reference to bean 'gemfireCache' while setting bean property 'cache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gemfireCache': FactoryBean threw exception on object creation; nested exception is java.util.ServiceConfigurationError: org.apache.geode.internal.cache.CacheService: Provider org.apache.geode.cache.lucene.internal.LuceneServiceImpl could not be instantiated
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:732)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:474)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1256)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1105)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
    at hello.Application.main(Application.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personRepository': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'People': Cannot resolve reference to bean 'gemfireCache' while setting bean property 'cache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gemfireCache': FactoryBean threw exception on object creation; nested exception is java.util.ServiceConfigurationError: org.apache.geode.internal.cache.CacheService: Provider org.apache.geode.cache.lucene.internal.LuceneServiceImpl could not be instantiated
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:589)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:818)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:724)
    ... 26 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'People': Cannot resolve reference to bean 'gemfireCache' while setting bean property 'cache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gemfireCache': FactoryBean threw exception on object creation; nested exception is java.util.ServiceConfigurationError: org.apache.geode.internal.cache.CacheService: Provider org.apache.geode.cache.lucene.internal.LuceneServiceImpl could not be instantiated
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:378)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1611)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1363)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:580)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:515)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:503)
    at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1198)
    at org.springframework.data.gemfire.repository.support.GemfireRepositoryFactoryBean.setApplicationContext(GemfireRepositoryFactoryBean.java:102)
    at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:120)
    at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:96)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:424)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1700)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:581)
    ... 36 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gemfireCache': FactoryBean threw exception on object creation; nested exception is java.util.ServiceConfigurationError: org.apache.geode.internal.cache.CacheService: Provider org.apache.geode.cache.lucene.internal.LuceneServiceImpl could not be instantiated
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:178)
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:101)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1645)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1184)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:257)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:367)
    ... 54 more
Caused by: java.util.ServiceConfigurationError: org.apache.geode.internal.cache.CacheService: Provider org.apache.geode.cache.lucene.internal.LuceneServiceImpl could not be instantiated
    at java.util.ServiceLoader.fail(Unknown Source)
    at java.util.ServiceLoader.access$100(Unknown Source)
    at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
    at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
    at java.util.ServiceLoader$1.next(Unknown Source)
    at org.apache.geode.internal.cache.GemFireCacheImpl.initializeServices(GemFireCacheImpl.java:1228)
    at org.apache.geode.internal.cache.GemFireCacheImpl.initialize(GemFireCacheImpl.java:1185)
    at org.apache.geode.internal.cache.GemFireCacheImpl.basicCreate(GemFireCacheImpl.java:758)
    at org.apache.geode.internal.cache.GemFireCacheImpl.createClient(GemFireCacheImpl.java:731)
    at org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:262)
    at org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:212)
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:400)
    at org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:315)
    at org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:265)
    at java.util.Optional.orElseGet(Unknown Source)
    at org.springframework.data.gemfire.CacheFactoryBean.getObject(CacheFactoryBean.java:760)
    at org.springframework.data.gemfire.CacheFactoryBean.getObject(CacheFactoryBean.java:107)
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:171)
    ... 60 more
Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzer
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    ... 76 more
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.Analyzer
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 80 more
Caused by: java.util.zip.ZipException: invalid stored block lengths
    at java.util.zip.InflaterInputStream.read(Unknown Source)
    at org.springframework.boot.loader.jar.ZipInflaterInputStream.read(ZipInflaterInputStream.java:52)
    at sun.misc.Resource.getBytes(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)`enter code here`
    ... 87 more

I didn't change anything in the code. I just cloned it and tried to run it. Can anybody please shed some light on why this is happening? Perhaps the Spring example code is wrong? Looking at the Maven dependencies in Eclipse, Analyzer is clearly there. I tried removing the jars in .m2 but still got the same error. Thanks.

First, the Spring example code is correct.

Second, what does Eclipse dependencies have to do with the Spring Boot "executable" JAR? The important thing to look at is whether the right JAR dependencies were added to the Spring Boot "executable" JAR file.

So, I have not looked at this guide/sample in awhile, but everything seems to be in order.

First...

$ git fetch --all
Fetching origin
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 17 (delta 10), reused 16 (delta 10), pack-reused 1
Unpacking objects: 100% (17/17), done.
From github.com:spring-guides/gs-accessing-data-gemfire
   037f6d7..e12f231  master     -> origin/master
 * [new tag]         2.0.2.RELEASE -> 2.0.2.RELEASE
 * [new tag]         2.0.3.RELEASE -> 2.0.3.RELEASE

And...

$ git status
On branch master
Your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
nothing to commit, working directory clean

And...

$ git merge origin/master
Updating 037f6d7..e12f231
Fast-forward
 complete/build.gradle | 6 +++---
 complete/pom.xml      | 2 +-
 initial/build.gradle  | 6 +++---
 initial/pom.xml       | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

Then...

$ mvn clean package
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building gs-accessing-data-gemfire 0.1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ gs-accessing-data-gemfire ---
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ gs-accessing-data-gemfire ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/src/main/resources
[INFO] skip non existing resourceDirectory /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ gs-accessing-data-gemfire ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ gs-accessing-data-gemfire ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ gs-accessing-data-gemfire ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ gs-accessing-data-gemfire ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ gs-accessing-data-gemfire ---
[INFO] Building jar: /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/target/gs-accessing-data-gemfire-0.1.0.jar
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.0.3.RELEASE:repackage (default) @ gs-accessing-data-gemfire ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.111 s
[INFO] Finished at: 2018-07-16T10:27:55-07:00
[INFO] Final Memory: 36M/340M
[INFO] ------------------------------------------------------------------------

When I inspect the Spring Boot executable JAR ( target/gs-accessing-data-gemfire-0.1.0.jar ) contents, sure enough, I see the Lucene dependencies.

$ jar -tvf target/gs-accessing-data-gemfire-0.1.0.jar | less
...
294235 Fri Sep 08 19:46:40 PDT 2017 BOOT-INF/lib/geode-lucene-9.1.1.jar
1493435 Wed Feb 01 14:44:10 PST 2017 BOOT-INF/lib/lucene-analyzers-common-6.4.1.jar
2648855 Wed Feb 01 14:43:32 PST 2017 BOOT-INF/lib/lucene-core-6.4.1.jar
229916 Wed Feb 01 14:44:26 PST 2017 BOOT-INF/lib/lucene-queries-6.4.1.jar
 26143 Wed Feb 01 14:44:12 PST 2017 BOOT-INF/lib/lucene-analyzers-phonetic-6.4.1.jar
335042 Tue Oct 17 08:53:20 PDT 2017 BOOT-INF/lib/commons-codec-1.11.jar
404640 Wed Feb 01 14:44:26 PST 2017 BOOT-INF/lib/lucene-queryparser-6.4.1.jar
192594 Wed Feb 01 14:44:28 PST 2017 BOOT-INF/lib/lucene-sandbox-6.4.1.jar
1
...

So, when I run the Spring Boot, Pivotal GemFire application using the Spring Boot Maven Plugin, everything works as expected...

$ mvn spring-boot:run
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building gs-accessing-data-gemfire 0.1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> spring-boot-maven-plugin:2.0.3.RELEASE:run (default-cli) > test-compile @ gs-accessing-data-gemfire >>>
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ gs-accessing-data-gemfire ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/src/main/resources
[INFO] skip non existing resourceDirectory /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ gs-accessing-data-gemfire ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ gs-accessing-data-gemfire ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ gs-accessing-data-gemfire ---
[INFO] No sources to compile
[INFO] 
[INFO] <<< spring-boot-maven-plugin:2.0.3.RELEASE:run (default-cli) < test-compile @ gs-accessing-data-gemfire <<<
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.0.3.RELEASE:run (default-cli) @ gs-accessing-data-gemfire ---

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.3.RELEASE)

[info 2018/07/16 10:28:44.753 PDT <main> tid=0xb] Starting Application on jblum-mbpro-2.local with PID 88211 (/Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/target/classes started by jblum in /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete)

[info 2018/07/16 10:28:44.755 PDT <main> tid=0xb] No active profile set, falling back to default profiles: default

[info 2018/07/16 10:28:44.805 PDT <main> tid=0xb] Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@69d6e858: startup date [Mon Jul 16 10:28:44 PDT 2018]; root of context hierarchy

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Before accessing data in Pivotal GemFire...
    Adult Alice is 40 years old
    Baby Bob is 1 years old
    Teen Carol is 13 years old
Saving Alice, Bob and Carol to Pivotal GemFire...
Lookup each person by name...
    Adult Alice is 40 years old
    Baby Bob is 1 years old
    Teen Carol is 13 years old
Query adults (over 18):
    Adult Alice is 40 years old
Query babies (less than 5):
    Baby Bob is 1 years old
Query teens (between 12 and 20):
    Teen Carol is 13 years old
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.141 s
[INFO] Finished at: 2018-07-16T10:28:46-07:00
[INFO] Final Memory: 52M/569M
[INFO] ------------------------------------------------------------------------

And, when I run the same application using java -jar , everything runs as expected, also...

$ java -jar target/gs-accessing-data-gemfire-0.1.0.jar

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.3.RELEASE)

[info 2018/07/16 10:32:35.136 PDT <main> tid=0x1] Starting Application v0.1.0 on jblum-mbpro-2.local with PID 88232 (/Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete/target/gs-accessing-data-gemfire-0.1.0.jar started by jblum in /Users/jblum/pivdev/spring-gs-guides/gs-accessing-data-gemfire/complete)

[info 2018/07/16 10:32:35.139 PDT <main> tid=0x1] No active profile set, falling back to default profiles: default

[info 2018/07/16 10:32:35.214 PDT <main> tid=0x1] Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@6ee52dcd: startup date [Mon Jul 16 10:32:35 PDT 2018]; root of context hierarchy

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Before accessing data in Pivotal GemFire...
    Adult Alice is 40 years old
    Baby Bob is 1 years old
    Teen Carol is 13 years old
Saving Alice, Bob and Carol to Pivotal GemFire...
Lookup each person by name...
    Adult Alice is 40 years old
    Baby Bob is 1 years old
    Teen Carol is 13 years old
Query adults (over 18):
    Adult Alice is 40 years old
Query babies (less than 5):
    Baby Bob is 1 years old
Query teens (between 12 and 20):
    Teen Carol is 13 years old

The same application works when I build and run with Gradle as well...

$ gradlew clean build

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 4s
3 actionable tasks: 3 executed

$ ll build/libs/
total 122648
-rw-r--r--  1 jblum  staff  62792971 Jul 16 10:34 gs-accessing-data-gemfire-0.1.0.jar

$ jar -tvf build/libs/gs-accessing-data-gemfire-0.1.0.jar | less

$ gradlew bootRun

> Task :bootRun 
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.3.RELEASE)

Before accessing data in Pivotal GemFire...
        Adult Alice is 40 years old
        Baby Bob is 1 years old
        Teen Carol is 13 years old
Saving Alice, Bob and Carol to Pivotal GemFire...
Lookup each person by name...
        Adult Alice is 40 years old
        Baby Bob is 1 years old
        Teen Carol is 13 years old
Query adults (over 18):
        Adult Alice is 40 years old
Query babies (less than 5):
        Baby Bob is 1 years old
Query teens (between 12 and 20):
        Teen Carol is 13 years old


Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 4s
2 actionable tasks: 1 executed, 1 up-to-date

$ java -jar build/libs/gs-accessing-data-gemfire-0.1.0.jar 
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.3.RELEASE)

Before accessing data in Pivotal GemFire...
    Adult Alice is 40 years old
    Baby Bob is 1 years old
    Teen Carol is 13 years old
Saving Alice, Bob and Carol to Pivotal GemFire...
Lookup each person by name...
    Adult Alice is 40 years old
    Baby Bob is 1 years old
    Teen Carol is 13 years old
Query adults (over 18):
    Adult Alice is 40 years old
Query babies (less than 5):
    Baby Bob is 1 years old
Query teens (between 12 and 20):
    Teen Carol is 13 years old

Perhaps, check that you have updated this application (ie git pull ) and verify the versions are Spring Boot 2.0.3.RELEASE and Spring Data GemFire 2.0.8.RELEASE , respectively.

Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM