John Blum created GEODE-6430:
--------------------------------

             Summary: GFSH simply hangs when the objects queried are not 
resolvable on the classpath.
                 Key: GEODE-6430
                 URL: https://issues.apache.org/jira/browse/GEODE-6430
             Project: Geode
          Issue Type: Bug
          Components: gfsh
            Reporter: John Blum


If I run an OQL query in _Gfsh_ on data stored in a Region and none of the 
"application domain model classes" are on the system classpath of the server, 
or if I have not been deployed the application classes using the {{deploy}} 
command, then the `query` command in _Gfsh_ hangs!

For example, suppose I am using Apache Geode to manage (HTTP) Session state 
using _Spring Session_.  If I have the _Spring_ dependencies on the classpath, 
but none of the application classes on the classpath, nor "deployed" using the 
{{deploy}} command, then running the following query...

{code}
gfsh>query --query="SELECT session.id, attribute.key, attribute.value FROM 
/Sessions session, session.attributes attribute ORDER BY session.id ASC"
{code}

... causes the shell to hang!

In this use case, the users application creates a (HTTP) Session, stores 
application types in the Session and then persists the Session to GemFire.  
GemFire will successfully persist the Session containing the application types 
even though the application classes are not on the classpath, especially when 
serialized between the server and client, simply because GemFire does not need 
to deserialize the application class instances when storing the Session.  Only 
if a Delta is applied to the Session, or the application objects stored in the 
Session are queried, will GemFire cause a deserialization and attempt to 
resolve the class types of the application objects.  Otherwise, GemFire will 
retain the form of the object in which it received it.

The only Exception/error present was in the Locator/Manager's log file...

{code:java}
[severe 2019/02/19 14:39:26.128 PST Locator1 <P2P message reader for 
10.99.199.24(Server1:83106)<v1>:1025 shared unordered uid=1 port=63863> 
tid=0x5a] Error deserializing message
org.apache.geode.SerializationException: Could not create an instance of  
org.apache.geode.internal.cache.FunctionStreamingReplyMessage .
        at 
org.apache.geode.internal.InternalDataSerializer.invokeFromData(InternalDataSerializer.java:2540)
        at org.apache.geode.internal.DSFIDFactory.create(DSFIDFactory.java:990)
        at 
org.apache.geode.internal.InternalDataSerializer.readDSFID(InternalDataSerializer.java:2737)
        at 
org.apache.geode.internal.tcp.Connection.processNIOBuffer(Connection.java:3543)
        at 
org.apache.geode.internal.tcp.Connection.runNioReader(Connection.java:1827)
        at org.apache.geode.internal.tcp.Connection.run(Connection.java:1688)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.NotSerializableException
        at 
org.apache.geode.internal.cache.FunctionStreamingReplyMessage.fromData(FunctionStreamingReplyMessage.java:94)
        at 
org.apache.geode.internal.InternalDataSerializer.invokeFromData(InternalDataSerializer.java:2529)
        ... 6 more
Caused by: java.lang.ClassNotFoundException: 
org.springframework.session.data.gemfire.serialization.SerializationException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:686)
        at 
org.apache.geode.internal.InternalDataSerializer$DSObjectInputStream.resolveClass(InternalDataSerializer.java:3643)
       at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1868)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1751)
        at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2042)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2287)
        at 
java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:561)
        at java.lang.Throwable.readObject(Throwable.java:914)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1170)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2178)
        at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2069)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
        at 
org.apache.geode.internal.InternalDataSerializer.basicReadObject(InternalDataSerializer.java:3062)
        at org.apache.geode.DataSerializer.readObject(DataSerializer.java:2978)
        at 
org.apache.geode.internal.cache.FunctionStreamingReplyMessage.fromData(FunctionStreamingReplyMessage.java:90)
 {code}

Eventually, I see...

{code:java}
[warning 2019/02/19 14:39:40.922 PST Locator1 <RMI TCP 
Connection(1)-10.99.199.24> tid=0x53] 15 seconds have elapsed while waiting for 
replies: <FunctionStreamingResultCollector 15 waiting for 1 replies from 
[10.99.199.24(Server1:83106)<v1>:1025]> on 
10.99.199.24(Locator1:83101:locator)<ec><v0>:1024 whose current membership list 
is: [[10.99.199.24(Server1:83106)<v1>:1025, 
10.99.199.24(Locator1:83101:locator)<ec><v0>:1024]]
{code}





--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to