Coldbox [3.7] Railo 4.1 Railo Cache Provider throwing Null Exception

Hi

I have set up a Railo cache and I am trying to get it to work, but i am getting null pointer exception.

Application Execution ExceptionError Type: java.lang.NullPointerException : 0

Error Messages: java.lang.NullPointerException

Tag Context:
ID: ??
LINE: 243
Template: C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\cache\providers\RailoProvider.cfc
ID: ??
LINE: 160
Template: C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc
ID: ??
LINE: 26
Template: C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\views\structure\head.cfm
ID: ??
LINE: 1
Template: C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\views\structure\header.cfm
ID: ??
LINE: 338
Template: C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc

The head.cfm is simply

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

My Cachebox.cfc is

`

<!-----------------------------------------------------------------------

Actually this seems to be a generic Railo issue.

Do you have a default object cache defined in your Railo admin? If so, what kind? We need the full Java stack trace to see where the error is actually coming from since it’s probably inside the Java cache provider.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

HI Brad.
I have a eh cache lite defined and associated as default cache with object.

I think its purely a railo issue to do with cachePut and cacheGet. I have tried it outside Coldbox and i get the same issue. I have put a ticket into Railo google group. It could just be my env setup though i have tried it on another machine.

`

java.lang.NullPointerException
        at railo.runtime.cache.eh.EHCacheLite.init(EHCacheLite.java:344):344
        at railo.runtime.cache.CacheConnectionImpl.getInstance(CacheConnectionImpl.java:53):53
        at railo.runtime.cache.ServerCacheConnection.getInstance(ServerCacheConnection.java:42):42
        at railo.runtime.functions.cache.Util.getDefault(Util.java:68):68
        at railo.runtime.functions.cache.CacheGet.call(CacheGet.java:23):23
        at coldbox.system.cache.providers.railoprovider_cfc$cf._3(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\cache\providers\RailoProvider.cfc:241):241
        at coldbox.system.cache.providers.railoprovider_cfc$cf.udfCall(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\cache\providers\RailoProvider.cfc):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:106):106
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:377):377
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:283):283
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:608):608
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:491):491
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1702):1702
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:709):709
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1457):1457
        at coldbox.system.plugins.renderer_cfc$cf._1(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\coldbox\system\plugins\Renderer.cfc:160):160
        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:106):106
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:377):377
        at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:276):276
        at railo.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:709):709
        at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:735):735
        at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1467):1467
        at views.structure.head_cfm$cf.call(C:\Users\Blacka\Dropbox\Code\CFWorkspace\mcwr_ii.l\views\structure\head.cfm:26):26
        at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:815):815
        at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:762):762
        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:815):815
        at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:762):762
        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:106):106
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:377):377
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:283):283
        at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:700):700
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:709):709
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1457):1457
        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:106):106
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:377):377
        at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:276):276
        at railo.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:709):709
        at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:735):735
        at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1467):1467
        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:815):815
        at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:762):762
        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:106):106
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:377):377
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:283):283
        at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:700):700
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:709):709
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1457):1457
        at coldbox.system.plugins.renderer_cfc$cf._call000001(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:106):106
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:377):377
        at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:276):276
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:609):609
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:491):491
        at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1719):1719
        at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:735):735
        at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1467):1467
        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:106):106
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:377):377
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:283):283
        at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:700):700
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:709):709
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1457):1457
        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:106):106
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:377):377
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:283):283
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:608):608
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:491):491
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1702):1702
        at railo.runtime.listener.ModernAppListener.call(ModernAppListener.java:372):372
        at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:108):108
        at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18
        at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2108):2108
        at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2076):2076
        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:848):848
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:648):648
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455):455
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137):137
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:559):559
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231):231
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072):1072
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382):382
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193):193
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006):1006
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135):135
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255):255
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154):154
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116):116
        at org.eclipse.jetty.server.Server.handle(Server.java:365):365
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485):485
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926):926
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988):988
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635):635
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235):235
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82):82
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627):627
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51):51
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608):608
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543):543
        at java.lang.Thread.run(Thread.java:722):722

`

For sure, that stack trace shows the issue is with initializing the underlying cache client. Here’s that line of Java code and it’s preceding line:

Resource hashDir = config.getConfigDir().getRealResource(“ehcache”).getRealResource(createHash(arguments));
manager =((CacheManagerAndHashLite) managers.get(hashDir.getAbsolutePath())).manager;

One of those objects are coming back as NULL. I would start by double checking your configuration. Often time’s you might have a setting that is wrong or missing and the code simply doesn’t have good checks in place to ensure that doesn’t happen.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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