Hi Dharam-

Sorry no one, including myself, responded to you sooner.

Comments in-line below...


On Thu, Nov 10, 2016 at 3:04 AM, Thacker, Dharam <
[email protected]> wrote:

> Hi Jon & Team,
>
>
>
> We found few more issues while bootstrapping with latest spring-data-geode
> version. We don’t see the same with spring-data-gemfire though. I would
> request you to give it a try from your side as well.
>
>
>
> 1) Using log4j2 within Spring data geode, I get this problem for 
> jansi-64-1.8.dll
>
>
>
>
> *Steps to Reproduce:*
>
>
>
> *Machine: Windows 8, 64 bit*
>
> *Java: java version "1.8.0_74"*
>
> *Java(TM) SE Runtime Environment (build 1.8.0_74-b02)*
>
>
>
> *Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)*
>
>
>
> *>> POM Dependancy:*
>
>
>
> <dependency>
>
>        <groupId>org.springframework.data</groupId>
>
>        <artifactId>spring-data-*geode*</artifactId>
>
>        <version>1.0.0.APACHE-GEODE-INCUBATING-M3</version>
>
> </dependency>
>
>
>

NOTE - the latest version of *Spring Data Geode* is not
1.0.0.INCUBATING-RELEASE.



> *>> Open a gfsh prompt and run*
>
> *gfsh > start locator –name=locator1 –bind-address=localhost –port=10334*
>
>
>
> *>> Simple Spring Boot Jar with following at minimum,*
>
>
>
> <util:properties id=*"inlineGeodeProperties"*>
>
>        <prop key=*"locators"*>localhost[10334]</prop>
>
> </util:properties>
>
>
>
> <gfe:cache properties-ref=*"inlineGeodeProperties"*
>
>               critical-heap-percentage=
> *"${geode.cache.critical-heap-percentage}"*
>
>               eviction-heap-percentage=
> *"${geode.cache.eviction-heap-percentage}"*
>
>               pdx-serializer-ref=*"pdxSerializer"* />
>
>
>
> <gfe:cache-server
>
>               auto-startup=*"true"* bind-address=
> *"${geode.cache.server.bind-address}"*
>
>               port=*"${geode.cache.server.port}"* host-name-for-clients=
> *"${geode.cache.server.hostname-for-clients}"*
>
>               max-connections=*"${geode.cache.server.max-connections}"*/>
>
>
>
> java –jar SPRING-BOOT.jar
>
>
>
> *Error log:*
>
>
>
> Caused by: java.lang.UnsatisfiedLinkError: Could not load library.
> Reasons: [no jansi64-1.8 in java.library.path, no *jansi*-1.8 in
> java.library.path, no *jansi* in java.library.path,
> C:\Users\NAME\AppData\Local\*Temp*\*jansi*-64-1.8.*dll* (The process
> cannot access the file because it is being used by another process)]
>
>        at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:184)
> ~[*jansi*-1.8.jar!/:1.8]
>
>        at org.fusesource.hawtjni.runtime.Library.load(Library.java:142) ~[
> *jansi*-1.8.jar!/:1.8]
>
>        at org.fusesource.jansi.internal.Kernel32.*<clinit>*(Kernel32.java:37)
> ~[*jansi*-1.8.jar!/:1.8]
>
>        at org.fusesource.jansi.WindowsAnsiOutputStream.*<clinit>*(
> WindowsAnsiOutputStream.java:52) ~[*jansi*-1.8.jar!/:1.8]
>
>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method) ~[*na*:1.8.0_74]
>
>        at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:62) ~[*na*:1.8.0_74]
>
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:45) ~[*na*:1.8.0_74]
>
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> ~[*na*:1.8.0_74]
>
>        at org.apache.logging.log4j.core.appender.ConsoleAppender.
> getOutputStream(ConsoleAppender.java:275) ~[log4j-core-2.6.2.jar!/:2.6.2]
>
>        at org.apache.logging.log4j.core.appender.ConsoleAppender.
> getDefaultManager(ConsoleAppender.java:238) ~[log4j-core-2.6.2.jar!/:2.6.
> 2]
>
>        at org.apache.logging.log4j.core.appender.ConsoleAppender.
> createDefaultAppenderForLayout(ConsoleAppender.java:154)
> ~[log4j-core-2.6.2.jar!/:2.6.2]
>
>        at org.apache.logging.log4j.core.config.AbstractConfiguration.
> setToDefault(AbstractConfiguration.java:552) ~[log4j-core-2.6.2.jar!/:2.6.
> 2]
>
>        at org.apache.logging.log4j.core.config.DefaultConfiguration.
> *<init>*(DefaultConfiguration.java:47) ~[log4j-core-2.6.2.jar!/:2.6.2]
>
>        at 
> org.apache.logging.log4j.core.LoggerContext.*<init>*(LoggerContext.java:74)
> ~[log4j-core-2.6.2.jar!/:2.6.2]
>
>        at org.apache.logging.log4j.core.selector.
> ClassLoaderContextSelector.createContext(ClassLoaderContextSelector.java:171)
> ~[log4j-core-2.6.2.jar!/:2.6.2]
>
>        at org.apache.logging.log4j.core.selector.
> ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:145)
> ~[log4j-core-2.6.2.jar!/:2.6.2]
>
>        at org.apache.logging.log4j.core.selector.
> ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:74)
> ~[log4j-core-2.6.2.jar!/:2.6.2]
>
>        at org.apache.logging.log4j.core.impl.Log4jContextFactory.
> getContext(Log4jContextFactory.java:227) ~[log4j-core-2.6.2.jar!/:2.6.2]
>
>        at org.apache.logging.log4j.core.impl.Log4jContextFactory.
> getContext(Log4jContextFactory.java:45) ~[log4j-core-2.6.2.jar!/:2.6.2]
>
>        at org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)
> ~[log4j-*api*-2.6.2.jar!/:2.6.2]
>
>        at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:631)
> ~[log4j-*api*-2.6.2.jar!/:2.6.2]
>
>        at 
> com.gemstone.gemfire.internal.logging.LogService.init(LogService.java:73)
> ~[*geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at 
> com.gemstone.gemfire.internal.logging.LogService.*<clinit>*(LogService.java:70)
> ~[*geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at 
> com.gemstone.gemfire.internal.ClassPathLoader.*<clinit>*(ClassPathLoader.java:71)
> ~[*geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at com.gemstone.gemfire.internal.i18n.
> AbstractStringIdResourceBundle.initData(AbstractStringIdResourceBundle.java:62)
> ~[*geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at com.gemstone.gemfire.internal.i18n.
> AbstractStringIdResourceBundle.getBundle(AbstractStringIdResourceBundle.java:150)
> ~[*geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at com.gemstone.gemfire.i18n.StringId.getBundle(StringId.java:85)
> ~[*geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at com.gemstone.gemfire.i18n.StringId.setLocale(StringId.java:72)
> ~[*geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at com.gemstone.gemfire.i18n.StringId.*<clinit>*(StringId.java:54)
> ~[*geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at 
> com.gemstone.gemfire.internal.i18n.LocalizedStrings.*<clinit>*(LocalizedStrings.java:45)
> ~[*geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at com.gemstone.gemfire.cache.Scope.fromString(Scope.java:162) ~[
> *geode*-core-1.0.0-incubating.M3.jar!/:*na*]
>
>        at org.springframework.data.gemfire.ScopeConverter.
> convert(ScopeConverter.java:49) ~[spring-data-*geode*-1.0.0.
> APACHE-GEODE-INCUBATING-M3.jar!/:*na*]
>
>        at org.springframework.data.gemfire.ScopeConverter.
> convert(ScopeConverter.java:32) ~[spring-data-*geode*-1.0.0.
> APACHE-GEODE-INCUBATING-M3.jar!/:*na*]
>
>        at org.springframework.data.gemfire.support.
> AbstractPropertyEditorConverterSupport.setAsText(
> AbstractPropertyEditorConverterSupport.java:64) ~[spring-data-*geode*
> -1.0.0.APACHE-GEODE-INCUBATING-M3.jar!/:*na*]
>
>        at org.springframework.beans.TypeConverterDelegate.
> doConvertTextValue(TypeConverterDelegate.java:468)
> ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
>
>        at org.springframework.beans.TypeConverterDelegate.doConvertValue(
> TypeConverterDelegate.java:441) ~[spring-beans-4.3.3.RELEASE.
> jar!/:4.3.3.RELEASE]
>
>        at org.springframework.beans.TypeConverterDelegate.
> convertIfNecessary(TypeConverterDelegate.java:199)
> ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
>
>        at org.springframework.beans.AbstractNestablePropertyAccess
> or.convertIfNecessary(AbstractNestablePropertyAccessor.java:576)
> ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
>
>        at org.springframework.beans.AbstractNestablePropertyAccess
> or.convertForProperty(AbstractNestablePropertyAccessor.java:603)
> ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
>
>        at 
> org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:216)
> ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
>
>        at org.springframework.beans.factory.support.
> AbstractAutowireCapableBeanFactory.convertForProperty(
> AbstractAutowireCapableBeanFactory.java:1532)
> ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
>
>        at org.springframework.beans.factory.support.
> AbstractAutowireCapableBeanFactory.applyPropertyValues(
> AbstractAutowireCapableBeanFactory.java:1491)
> ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
>
>        at org.springframework.beans.factory.support.
> AbstractAutowireCapableBeanFactory.populateBean(
> AbstractAutowireCapableBeanFactory.java:1231)
> ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
>
>        at
> *org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)*
> ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
>
>        ... 62 common frames omitted
>
>
>
>
>
> [Not sure if there is any way to avoid this error]
>
>
I guess the most obvious question maybe, what does your CLASSPATH look
like?  And...

Also, have you downloaded and installed a full binary distribution of
Apache Geode?  If so, you could try setting the $GEODE (%GEODE% on Windows)
environment variable to the installation directory.

It seems you are running your *Spring Boot*-based Geode Server as a *Spring
Boot* application fat JAR, which will contain all the dependencies required
by the application at runtime.  As you may already know, *Spring Boot* uses
a special Java ClassLoader contained in *Spring Boot* application (fat) JAR
file that knows how to resolve classes from within embedded JAR/libs
bundled in the application (fat) JAR.  I am not sure how this may work for
DLL files, but I would think it also partially depends on jansi knowing how
to resolve the DDL as a "JAR file resource" if it too were bundled in the
application (fat) JAR.  This may work, or it maybe able to resolve the DLL
if the %GEODE%/lib as on the (System) classpath as well.


>
>
> 2) Related to spring-shell(with or without exclusion of spring-core and
> spring-context-support), gfsh-dependencies/geode-dependencies we always
> get error in gfsh console and similar info logs from java while running
> server,
>
>
>
> *Exception occurred. Command can not be processed as Command Service did
> not get initialized. Reason: Could not find Spring Shell library which is
> needed for CLI/gfsh in classpath. Internal support for CLI & gfsh is not
> enabled. Note: For convenience, absolute path of "gfsh-dependencies.jar"
> from "lib" directory of GemFire product distribution can be included in
> CLASSPATH of an application.*
>
>
>
> *How do we run server?*
>
>
>

It is a PITA, but just put the appropriate *Spring Shell* dependency on the
application runtime CLASSPATH (or bundle it in your *Spring Boot*
application (fat) JAR file).  It is a benign Exception (and an annoying one
at that), but putting the *Spring Shell* dependency on the runtime CLASSPATH
causes the Exception to go away.

It would have been more appropriate if Geode just logged a "warning" about
the *Spring Shell* dependency not being available since it is only
pertinent if the Geode Server needs to function as a Manager as well, in
which case, the the "command" classes implemented in Geode for *Gfsh* (and
executed by the Manger as well) would require the *Spring Shell* classes
(NOTE, some of the *Gfsh* commands are remote commands meaning they run
only on the servers in the cluster, e.g. `create region`).  But if your
server is not a Manager (and in your case, it is not), then it is a
non-issue.  I think this got fixed in Apache Geode 1.0.0-incubating (???).

I often put *Spring Shell* on my runtime CLASSPATH
<https://github.com/jxblum/contacts-application/blob/apache-geode/configuration-example/pom.xml#L81-L86>
[1]
to make my Geode Server
<https://github.com/jxblum/contacts-application/blob/apache-geode/configuration-example/src/main/java/example/app/spring/java/geode/server/JavaConfiguredGeodeServerApplication.java#L77-L83>
[2]
many things, first and foremost a Manager so I can connect to it in *Gfsh*.
I also set the start-locator Geode (System) property which starts an
embedded Locator allowing other members (peers) to join, forming a cluster,
it's a CacheServer
<https://github.com/jxblum/contacts-application/blob/apache-geode/configuration-example/src/main/java/example/app/spring/java/geode/server/JavaConfiguredGeodeServerApplication.java#L98-L117>
[3]
for clients to connect, etc.  Here is the same configuration
<https://github.com/jxblum/contacts-application/blob/apache-geode/configuration-example/src/main/java/example/app/spring/annotation/geode/server/AnnotationConfiguredGeodeServerApplication.java#L46-L58>
[4],
but simply using the new SDG Annotation configuration model.  Note, it also
is configured with SSL (by way of example).


[1]
https://github.com/jxblum/contacts-application/blob/apache-geode/configuration-example/pom.xml#L81-L86
[2]
https://github.com/jxblum/contacts-application/blob/apache-geode/configuration-example/src/main/java/example/app/spring/java/geode/server/JavaConfiguredGeodeServerApplication.java#L77-L83
[3]
https://github.com/jxblum/contacts-application/blob/apache-geode/configuration-example/src/main/java/example/app/spring/java/geode/server/JavaConfiguredGeodeServerApplication.java#L98-L117
[4]
https://github.com/jxblum/contacts-application/blob/apache-geode/configuration-example/src/main/java/example/app/spring/annotation/geode/server/AnnotationConfiguredGeodeServerApplication.java#L46-L58

Here is an example for many of my class

[As it’s spring boot app, we have to use loader.path]
>
>
>
> Java -Dloader.path=”$GEODE-HOME/lib,MYAPPLICATION.jar” –jar
> MYAPPLICATION.jar
>
>
>
> Though it’s known bug, I think it would be good to include
> gfsh-dependencies/geode-dependencies along with spring-shell by default
> in POM to avoid such confusions and explorations.
>
>
>

This should not be required in Apache Geode 1.0.0-incubating an after since
this Exception Stack Trace should go away.


>
>
> Thanks & Regards,
>
> Dharam Thacker
>
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of securities,
> accuracy and completeness of information, viruses, confidentiality, legal
> privilege, and legal entity disclaimers, available at
> http://www.jpmorgan.com/pages/disclosures/email
>

Reply via email to