Hi @Lyle_Karstensen , there might be some conflict among the 10 Jar files you are using. Perhaps an incompatibility when some of them are used together.
I say this because, when I experimented with your code and Jar files on ColdFusion 2025, I got ClassNotFoundException and ClassCastException. That prompted me to look for an implementation that works without errors and that contains the minimum set of Jar files.
I found one. Its description follows.
The Jar files required:
- jedis-6.0.0.jar
- commons-pool2-2.12.1.jar
- commons-logging-1.2.jar
The set-up (directories and files, under the web-root):
/redis_test/jars/jedis-6.0.0.jar
/redis_test/jars/commons-logging-1.2.jar
/redis_test/jars/commons-pool2-2.12.1.jar
/redis_test/Application.cfc
/redis_test/default.cfm
The test code:
Application.cfc
<cfcomponent>
<!--- Application settings --->
<cfset this.name = "MyRedisTest">
<cfset this.sessionManagement = true>
<cfset this.sessionTimeout = createTimeSpan(0, 0, 20, 0)>
<cfset this.applicationTimeout = createTimeSpan(1, 0, 0, 0)>
<!--- Jars stored in the directory redis_test/jars/ under the ROOT --->
<cfset this.javaSettings = {
loadPaths = [expandPath("/redis_test/jars/")],
loadColdFusionClassPath = true,
reloadOnChange = true,
watchInterval = 5
} />
<!--- Called when the application is first initialized --->
<cffunction name="onApplicationStart" returnType="boolean">
<cfreturn true>
</cffunction>
<!--- Called when a session starts --->
<cffunction name="onSessionStart" returnType="void">
</cffunction>
<!--- Called for every request --->
<cffunction name="onRequestStart" returnType="boolean">
<cfargument name="targetPage" type="string" required="true">
<cfreturn true>
</cffunction>
</cfcomponent>
default.cfm
<cfscript>
redisUri = "redis://redis:6379";
try {
uri = createObject("java", "java.net.URI").init(redisUri);
jedisPooled = createObject("java", "redis.clients.jedis.JedisPooled");
genericObjectPoolConfig = createObject("java", "org.apache.commons.pool2.impl.GenericObjectPoolConfig").init();
hostAndPort = createObject("java", "redis.clients.jedis.HostAndPort").init("redis://redis",6379);
genericObjectPoolConfig.setMaxTotal(100);
genericObjectPoolConfig.setMaxIdle(10);
genericObjectPoolConfig.setMinIdle(10);
genericObjectPoolConfig.setTestOnBorrow(true);
genericObjectPoolConfig.setBlockWhenExhausted(true);
genericObjectPoolConfig.setMaxWaitMillis(3000);
genericObjectPoolConfig.setTestOnCreate(true);
genericObjectPoolConfig.setTestWhileIdle(false);
genericObjectPoolConfig.setTimeBetweenEvictionRunsMillis(60000);
genericObjectPoolConfig.setMinEvictableIdleTimeMillis(300000);
redisConnection = jedisPooled.init(genericObjectPoolConfig, uri);
// Alternative definition of 'redisConnection' to be tested
// redisConnection = jedisPooled.init(hostAndPort,genericObjectPoolConfig);
writedump(var=redisConnection, label="Dump of redisConnection");
}
catch(any e){
writedump(e);
}
</cfscript>
Test procedure:
- Launch the file
default.cfm
in a browser. You should get the dump of the redisConnection
object.
- Comment out the line
redisConnection = jedisPooled.init(genericObjectPoolConfig, uri);
and uncomment the line redisConnection = jedisPooled.init(hostAndPort,genericObjectPoolConfig);
.
- Relaunch the file
default.cfm
in a browser. You should again get the dump of the redisConnection
object.
Lucee version: lucee-express-6.2.1.122
ColdFusion version: ColdFusion 2025 Update 2
Operating System: Windows 10 Pro