CB 3.7 - Couchbase Provider Error when no timeout provided on renderView

Hi
I am trying the new couchbase provider on railo 4.1

I have in my code…

`
#renderView(view:"/structure/modules/gigyaSocializeScript", cache:true)#

`

My config is

`

cacheBox.caches = {
“template” = {
provider = “coldbox.couchbase.CouchbaseColdBoxProvider”
,properties= {
servers=“http://xxxx:8091
,bucket=“DEV-BOB”
,jarPath="#application.cbController.getAppRootPath()#coldbox\couchbase\jars"
,password=“xxxxx”
,objectDefaultTimeout = 15
,opQueueMaxBlockTime = 5000
,opTimeout = 5000
,timeoutExceptionThreshold = 5000
,ignoreCouchBaseTimeouts = true
}
}
};

`

Problem seems to be in setQuiet
timeout argument is being passed in as empty string so is not triggering the default

`
any timeout=instance.configuration.objectDefaultTimeout,

`

instance.configuration.objectDefaultTimeout is 15 which is correct

This then causes a an error at javaCast( “int”,arguments.timeout*60 ) in the set statement

future = getCouchbaseClient()
.set( javaCast( “string”, arguments.objectKey ), javaCast( “int”,arguments.timeout*60 ), sElement );

Its an easy fix…

`
if ( not isNumeric(arguments.timeout) ) arguments.timeout = instance.configuration.objectDefaultTimeout;

`

`

can't cast empty string to a number value
	at railo.runtime.op.Caster.toDoubleValue(Caster.java:448):448
	at railo.runtime.op.Caster.toDoubleValue(Caster.java:414):414
	at railo.runtime.op.Operator.multiplyRef(Operator.java:894):894
	at coldbox.couchbase.couchbaseprovider_cfc$cf._4(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\couchbase\CouchbaseProvider.cfc:697):697
	at coldbox.couchbase.couchbaseprovider_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\couchbase\CouchbaseProvider.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307
	at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:198):198
	at railo.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:709):709
	at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:738):738
	at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1504):1504
	at coldbox.couchbase.couchbaseprovider_cfc$cf._4(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\couchbase\CouchbaseProvider.cfc:638):638
	at coldbox.couchbase.couchbaseprovider_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\couchbase\CouchbaseProvider.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:211):211
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:612):612
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:495):495
	at railo.runtime.ComponentImpl.call(ComponentImpl.java:1708):1708
	at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:712):712
	at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1494):1494
	at coldbox.system.plugins.renderer_cfc$cf._1(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc:192):192
	at coldbox.system.plugins.renderer_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307
	at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:198):198
	at railo.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:709):709
	at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:738):738
	at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1504):1504
	at views.structure.head_cfm$cf.call(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\views\structure\head.cfm:38):38
	at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:833):833
	at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:780):780
	at views.structure.header_cfm$cf.call(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\views\structure\header.cfm:1):1
	at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:833):833
	at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:780):780
	at coldbox.system.plugins.renderer_cfc$cf._1(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc:339):339
	at coldbox.system.plugins.renderer_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:211):211
	at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:700):700
	at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:712):712
	at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1494):1494
	at coldbox.system.plugins.renderer_cfc$cf._1(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc:183):183
	at coldbox.system.plugins.renderer_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307
	at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:198):198
	at railo.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:709):709
	at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:738):738
	at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1504):1504
	at layouts.main_cfm$cf.call(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\layouts\main.cfm:3):3
	at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:833):833
	at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:780):780
	at coldbox.system.plugins.renderer_cfc$cf._1(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc:339):339
	at coldbox.system.plugins.renderer_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:211):211
	at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:700):700
	at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:712):712
	at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1494):1494
	at coldbox.system.plugins.renderer_cfc$cf._call000065(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc:477):477
	at coldbox.system.plugins.renderer_cfc$cf._1(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc:431):431
	at coldbox.system.plugins.renderer_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307
	at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:198):198
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:613):613
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:495):495
	at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1725):1725
	at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:738):738
	at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1504):1504
	at coldbox.system.coldbox_cfc$cf._1(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\Coldbox.cfc:256):256
	at coldbox.system.coldbox_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\Coldbox.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:211):211
	at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:700):700
	at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:712):712
	at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1494):1494
	at application_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\Application.cfc:44):44
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:211):211
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:612):612
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:495):495
	at railo.runtime.ComponentImpl.call(ComponentImpl.java:1708):1708
	at railo.runtime.listener.ModernAppListener.call(ModernAppListener.java:373):373
	at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:109):109
	at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18
	at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2149):2149
	at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2116):2116
	at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:318):318
	at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:29):29
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728):728
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305):305
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222):222
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123):123
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472):472
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171):171
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99):99
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407):407
	at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200):200
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589):589
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310):310
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source):-1
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source):-1
	at java.lang.Thread.run(Unknown Source):-1

`

Thanks for the heads up. Not sure how I didn’t see that when I tested the provider with view caching. Ticket entered:

https://ortussolutions.atlassian.net/browse/CACHEBOX-15

Feel free to submit a pull request. :slight_smile: The code is located here:
https://github.com/ColdBox/cachebox-couchbase/blob/master/model/providers/Couchbase/CouchbaseProvider.cfc#L661

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com