title: Unable to Instantiate Class while Alter Region adding cache loaded to that region
body: <p>I have an apache geode setup where there is one locator and one Server. we have a region employee in that. we were trying to implement in-line cache where a cache miss will lookup into database and will fill apache geode, but after deployment of Jars when i am trying to alter the region . It shows exception</p>
  <pre><code>
  Stack Trace:
  [error 2021/04/09 15:18:30.513 IST &lt;Function Execution Processor2&gt; tid=0x3a] Error instantiating class: &lt;com.abc.geode.ApacheGeode.EmployeeCacheLoader&gt;
  java.lang.RuntimeException: Error instantiating class: &lt;com.abc.geode.ApacheGeode.EmployeeCacheLoader&gt;
      at org.apache.geode.management.internal.configuration.domain.DeclarableTypeInstantiator.newInstance(DeclarableTypeInstantiator.java:43)
      at org.apache.geode.management.internal.cli.functions.RegionAlterFunction.alterRegion(RegionAlterFunction.java:202)
      at org.apache.geode.management.internal.cli.functions.RegionAlterFunction.executeFunction(RegionAlterFunction.java:67)
      at org.apache.geode.management.cli.CliFunction.execute(CliFunction.java:37)
      at org.apache.geode.internal.cache.MemberFunctionStreamingMessage.process(MemberFunctionStreamingMessage.java:201)
      at org.apache.geode.distributed.internal.DistributionMessage.scheduleAction(DistributionMessage.java:372)
      at org.apache.geode.distributed.internal.DistributionMessage$1.run(DistributionMessage.java:436)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.geode.distributed.internal.ClusterOperationExecutors.runUntilShutdown(ClusterOperationExecutors.java:475)
      at org.apache.geode.distributed.internal.ClusterOperationExecutors.doFunctionExecutionThread(ClusterOperationExecutors.java:393)
      at org.apache.geode.logging.internal.executors.LoggingThreadFactory.lambda$newThread$0(LoggingThreadFactory.java:119)
      at java.lang.Thread.run(Unknown Source)
  Caused by: java.lang.ClassCastException: com.abc.geode.ApacheGeode.EmployeeCacheLoader cannot be cast to org.apache.geode.cache.Declarable
      at org.apache.geode.management.internal.configuration.domain.DeclarableTypeInstantiator.newInstance(DeclarableTypeInstantiator.java:34)
  </code></pre>
  <pre><code>public class EmployeeCacheLoader implements CacheLoader&lt;Long,Employee&gt;, Declarable {
  
      @Override
      public Employee load(LoaderHelper&lt;Long, Employee&gt; helper) throws CacheLoaderException {
         Employee e=new Employee();
         e.setEmail(&quot;a@b.com&quot;);
         e.setIdemployee(2L);
          return e;
      }
  
      @Override
      public void close() {
      }
  
      @Override
      public void init(Properties props) {
         }
  </code></pre>
  <p>Things tried</p>
  <ol>
  <li>I tried by not implementing Declarable but still no success.</li>
  <li>I have not done any change for serializer.</li>
  </ol>