Hazelcast 3.6.4 client in glassfish war file

63 views
Skip to first unread message

hzuser

unread,
Jul 29, 2016, 11:10:51 AM7/29/16
to Hazelcast
We are running Hazelcast 3.6.4 client inside Glass fish 4.1 web application. 

Intermittently we see issues during the deployment, where Hazelcast  client doesn't get initialized properly,  with the following stack trace.

java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:669)
at java.util.zip.ZipFile.getEntry(ZipFile.java:309)
at java.util.jar.JarFile.getEntry(JarFile.java:240)
at java.util.jar.JarFile.getJarEntry(JarFile.java:223)
at org.apache.naming.resources.WebDirContext.lookupFromJars(WebDirContext.java:325)
at org.apache.naming.resources.WebDirContext.getAttributes(WebDirContext.java:298)
at org.apache.naming.resources.BaseDirContext.getAttributes(BaseDirContext.java:787)
at org.apache.naming.resources.ProxyDirContext.cacheLoad(ProxyDirContext.java:1533)
at org.apache.naming.resources.ProxyDirContext.cacheLookup(ProxyDirContext.java:1456)
at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:274)
at org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromRepositories(WebappClassLoader.java:2892)
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2842)
at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2736)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1194)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1750)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633)
at com.hazelcast.client.impl.protocol.ClientExceptionFactory.<init>(ClientExceptionFactory.java:424)
at com.hazelcast.client.spi.impl.ClientInvocationServiceSupport.initClientExceptionFactory(ClientInvocationServiceSupport.java:91)
at com.hazelcast.client.spi.impl.ClientInvocationServiceSupport.start(ClientInvocationServiceSupport.java:81)
at com.hazelcast.client.spi.impl.ClientSmartInvocationServiceImpl.start(ClientSmartInvocationServiceImpl.java:30)
at com.hazelcast.client.impl.HazelcastClientInstanceImpl.start(HazelcastClientInstanceImpl.java:305)
at com.hazelcast.client.HazelcastClient.newHazelcastClient(HazelcastClient.java:86)

This happens with Hazelcast 3.5 on both java 7 and Java 8.  It can be reproduced on Hazelcast 3.6.4 as well.
Is there a specific dependency which is missing or getting corrupt,  or is it osgi issue or is there a way the client has to be initialized differently when inside a osgi container?


Thanks

Jaromir Hamala

unread,
Jul 29, 2016, 11:38:58 AM7/29/16
to Hazelcast
Hi,

It looks like a Glassfish to me. It's similar (but not 100% same) to https://java.net/jira/browse/GLASSFISH-21522 
Can you try it with Payara? It's a drop-in replacement of Glassfish - it should be trivial to try your use-case. Payara engneers have fixed a very similar bug https://github.com/payara/Payara/issues/693

Cheers,
Jaromir

hzuser

unread,
Aug 2, 2016, 7:14:54 PM8/2/16
to Hazelcast
Thanks Jaromir,

   Starting the HZ client in a client thread in glassfish seems to be the issue. Moving the client start code inline fixed the issue

Jaromir Hamala

unread,
Aug 3, 2016, 6:10:55 AM8/3/16
to Hazelcast
Hi,


this is great to know, many thanks for heads-up!

Cheers,
Jaromir
Reply all
Reply to author
Forward
0 new messages