Thanks George and John!

That's true! This issue does not appear in 1.0.0.Incubating due to reason 
explained by George.

Thanks & Regards,
Dharam

Sent with Good Work (www.blackberry.com)

On Nov 17, 2016 9:17 PM, George Wilder <[email protected]> wrote:
Regarding the jansi issue on Windows, Comments in-line at bottom…


From: John Blum [mailto:[email protected]]
Sent: Wednesday, November 16, 2016 8:06 PM
To: Thacker, Dharam <[email protected]>
Cc: [email protected]
Subject: Re: Issues with spring-data-geode[1.0.0.APACHE-GEODE-INCUBATING-M3/M3+]

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]<mailto:[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.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:576)
 ~[spring-beans-4.3.3.RELEASE.jar!/:4.3.3.RELEASE]
       at 
org.springframework.beans.AbstractNestablePropertyAccessor.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.



Looks like the DLL is getting locked on use.

In version 1.8, jansi copies the dll to the user’s AppData\Local\temp as 
“jansi-64-1.8.dll”.
In the newer versions, it appears they copy the dll to AppData\Local\temp with 
a random hash in the name: “jansi-64-903216579516516988.dll”.

A potential workaround is to bump version up where it uses the name mangling:

    runtime "org.fusesource.jansi:jansi:1.13"

Downside of running like this is you get a copy in \temp each time you restart, 
so you’d need to monitor and clean up over time.


[munch]

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