<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: ExecuteGroovyScript: The following classes appear as argument class and as parameter class, but are defined by different class loader in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/ExecuteGroovyScript-The-following-classes-appear-as-argument/m-p/379780#M243928</link>
    <description>&lt;P&gt;Did you try what the error says?&lt;/P&gt;&lt;P&gt;Possible solutions: scan(org.springframework.data.redis.core.KeyScanOptions)&lt;/P&gt;</description>
    <pubDate>Tue, 28 Nov 2023 17:40:06 GMT</pubDate>
    <dc:creator>joseomjr</dc:creator>
    <dc:date>2023-11-28T17:40:06Z</dc:date>
    <item>
      <title>ExecuteGroovyScript: The following classes appear as argument class and as parameter class, but are defined by different class loader</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ExecuteGroovyScript-The-following-classes-appear-as-argument/m-p/379750#M243913</link>
      <description>&lt;P&gt;Just trying to use a simple Groovy Script for setting TTL on redis keys with a given pattern.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;@Grab(group='org.springframework.data', module='spring-data-redis', version='2.6.2')
import org.springframework.data.redis.connection.RedisConnection
import org.springframework.data.redis.core.ScanOptions


def pool = CTL.redis.getConnection()
pool.withCloseable {conn-&amp;gt;
  def keyPattern = 'raw:extra:*'
  def scanOptions = ScanOptions.scanOptions().match(keyPattern).build()
  def cursor = conn.keyCommands().scan(scanOptions)
  while(cursor.hasNext()) {
    def key = cursor.next()
    // Check if the key has a TTL
    if(conn.keyCommands().pTtl(key) == -1) {
      // Set a 15 days TTL for the key
      conn.keyCommands().expire(key, 15 * 24 * 60 * 60)
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However this is giving this specific error. I tried using KeyScanOptions, without grabbing the spring-data-redis and a builder. Still getting the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ExecuteGroovyScript[id=6f743677-05b0-1622-bb0b-cbb0e5127a50] groovy.lang.MissingMethodException: No signature of method: com.sun.proxy.$Proxy6940493.scan() is applicable for argument types: (org.springframework.data.redis.core.ScanOptions) values: [org.springframework.data.redis.core.ScanOptions@558a5d9a]
Possible solutions: scan(org.springframework.data.redis.core.KeyScanOptions), scan(org.springframework.data.redis.core.ScanOptions), any(), each(groovy.lang.Closure), tap(groovy.lang.Closure), any(groovy.lang.Closure)
The following classes appear as argument class and as parameter class, but are defined by different class loader:
org.springframework.data.redis.core.ScanOptions (defined by 'groovy.lang.GroovyClassLoader@2ddbb9b9' and 'org.apache.nifi.nar.NarClassLoader[./work/nar/extensions/nifi-redis-service-api-nar-1.16.0.nar-unpacked]')
If one of the method suggestions matches the method you wanted to call, 
then check your class loader setup.: groovy.lang.MissingMethodException: No signature of method: com.sun.proxy.$Proxy6940493.scan() is applicable for argument types: (org.springframework.data.redis.core.ScanOptions) values: [org.springframework.data.redis.core.ScanOptions@558a5d9a]
Possible solutions: scan(org.springframework.data.redis.core.KeyScanOptions), scan(org.springframework.data.redis.core.ScanOptions), any(), each(groovy.lang.Closure), tap(groovy.lang.Closure), any(groovy.lang.Closure)
The following classes appear as argument class and as parameter class, but are defined by different class loader:
org.springframework.data.redis.core.ScanOptions (defined by 'groovy.lang.GroovyClassLoader@2ddbb9b9' and 'org.apache.nifi.nar.NarClassLoader[./work/nar/extensions/nifi-redis-service-api-nar-1.16.0.nar-unpacked]')
If one of the method suggestions matches the method you wanted to call, 
then check your class loader setup.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the folder and it has spring-data-redis:2.6.2 under this one. I also tried using keys for key lookup and it works but I don't want to use keys for performance reasons. Other functions are working fine but just ScanOptions is giving this specific error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 10:42:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ExecuteGroovyScript-The-following-classes-appear-as-argument/m-p/379750#M243913</guid>
      <dc:creator>msdalp</dc:creator>
      <dc:date>2023-11-28T10:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteGroovyScript: The following classes appear as argument class and as parameter class, but are defined by different class loader</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ExecuteGroovyScript-The-following-classes-appear-as-argument/m-p/379780#M243928</link>
      <description>&lt;P&gt;Did you try what the error says?&lt;/P&gt;&lt;P&gt;Possible solutions: scan(org.springframework.data.redis.core.KeyScanOptions)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 17:40:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ExecuteGroovyScript-The-following-classes-appear-as-argument/m-p/379780#M243928</guid>
      <dc:creator>joseomjr</dc:creator>
      <dc:date>2023-11-28T17:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteGroovyScript: The following classes appear as argument class and as parameter class, but are defined by different class loader</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ExecuteGroovyScript-The-following-classes-appear-as-argument/m-p/379923#M243956</link>
      <description>&lt;P&gt;yea I tried using&amp;nbsp;&lt;SPAN&gt;KeyScanOptions as well but the same error&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 08:26:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ExecuteGroovyScript-The-following-classes-appear-as-argument/m-p/379923#M243956</guid>
      <dc:creator>msdalp</dc:creator>
      <dc:date>2023-11-30T08:26:19Z</dc:date>
    </item>
  </channel>
</rss>

