Mario Kevo created GEODE-6716:
---------------------------------

             Summary: Multiple ClassLoaders created for a single deployed jar
                 Key: GEODE-6716
                 URL: https://issues.apache.org/jira/browse/GEODE-6716
             Project: Geode
          Issue Type: Bug
          Components: functions
            Reporter: Mario Kevo


{color:#333333}When deploying the jar if all jar Classes are not loaded before 
a new deploy operation is issued Classes that were not loaded, when loaded, 
will use a different ClassLoader object. Therefore, all objects created by 
Classes with new ClassLoader will be incompatible with objects created by 
Classes with an old ClassLoader.{color}

Fault is with JarDeployer Geode Class, deploy function, in which even if the 
deployed jar is the same a new ClassLoader object will be created and replace 
the old one.

To reproduce the issue deploy some jar with an object declaration and a 
function that manages those objects. Then insert a few objects and deploy the 
same jar again without executing the function. Now when executing the function, 
function Class and its objects are created with a new ClassLoader and not 
castable to the object Class which uses the old ClassLoader.

Expected error:
{code:java}
org.apache.geode.cache.execute.FunctionException: java.lang.ClassCastException: 
class {class.name} cannot be cast to class {class.name} ({class.name} is in 
unnamed module of loader java.net.URLClassLoader @5a57081e; {class.name} is in 
unnamed module of loader java.net.URLClassLoader @7efe7b87){code}
 



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

Reply via email to