Closed aaronhcox closed 12 years ago
Which version of Railo? What is in your Application.cfc?
Looking at the source of Railo, it sounds like you have this.datasource set to a struct instead of a string. If you believe a struct should be allowed there, then this is a Railo bug and has nothing to do with FW/1.
I'm using the standalone Jetty Railo 3.3.1.000 on OS X 10.6.8.
Structure for the "app": Application.cfc index.cfm (empty) /orm/documents.cfc (empty persistent CFC mapped to a table in my app datasource) /views/home/index.cfm (line 1 is ORMReload(), line 2 is a dump of Request)
Here's my Application.cfc:
component extends="cfextensions.fw1.org.corfield.framework_2_0" output="false" { This.name = 'fw1test';
This.datasource.name = 'ntp_ctt';
This.rootDirectory = getDirectoryFromPath(getCurrentTemplatePath());
This.mappings['/app'] = This.rootDirectory;
This.mappings['/orm'] = This.rootDirectory & 'orm';
This.ormenabled = true;
This.ormsettings.cfclocation = 'orm';
Variables.framework = {
defaultItem = 'index'
, defaultSection = 'home'
, error = 'home.index'
, home = 'home.index'
};
}
Sean,
I just tried another variation, removing the extension of FW/1 and putting ORMReload() in my root index.cfm, and I am still getting this error, so it looks like you're right about FW/1 not actually being key to this. I am using a string as the datasource, so I'm still in a rut. Thanks for looking into this, though, I do appreciate it.
Aaron
this.datasource.name - that makes this.datasource a struct which is what Railo is failing on. Try this.datasource = 'ntp_ctt';
It's friday, and I was clearly thinking way too hard. That works. I've been on ACF 9.0.1 and using the struct form for the datasource and completely glossed over this.datasource being able to be set as a standalone string. Thanks for the sanity and sorry for the clutter. By the way, thanks for publishing FW/1, it's easily my favorite CF framework.
When loading a barebones FW/1 (2.0) application, ORMReload() is throwing "Can't cast Complex Object Type Struct to String". I've tested ORM functions on Railo sans FW/1 (2.0) without this issue, but as soon as I extend FW/1 I get this error every time. This occurs with ORMReload either in Application.cfc:setupApplication() or in the default view .cfm. Here's the stack:
Can't cast Complex Object Type Struct to String at railo.runtime.type.util.StructSupport.castToString(StructSupport.java:197):197 at railo.runtime.op.Caster.toString(Caster.java:1762):1762 at railo.runtime.listener.ModernApplicationContext.reinitORM(ModernApplicationContext.java:165):165 at railo.runtime.functions.orm.ORMReload.call(ORMReload.java:22):22 at fw1test.views.home.index_cfm$cf.call(/webroot/railo/webroot/fw1test/views/home/index.cfm:1):1 at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:762):762 at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:715):715 at fw1.org.corfield.framework_2_0_cfc$cf.udfCall7(/webroot/cfextensions/fw1/org/corfield/framework_2_0.cfc:1368):1368 at fw1.org.corfield.framework_2_0_cfc$cf.udfCall(/webroot/cfextensions/fw1/org/corfield/framework_2_0.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:214):214 at railo.runtime.type.UDFImpl._call(UDFImpl.java:418):418 at railo.runtime.type.UDFImpl.call(UDFImpl.java:383):383 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:738):738 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1444):1444 at fw1.org.corfield.framework_2_0_cfc$cf.udfCall4(/webroot/cfextensions/fw1/org/corfield/framework_2_0.cfc:665):665 at fw1.org.corfield.framework_2_0_cfc$cf.udfCall(/webroot/cfextensions/fw1/org/corfield/framework_2_0.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:214):214 at railo.runtime.type.UDFImpl._call(UDFImpl.java:418):418 at railo.runtime.type.UDFImpl.call(UDFImpl.java:383):383 at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:738):738 at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1444):1444 at fw1.org.corfield.framework_2_0_cfc$cf.udfCall3(/webroot/cfextensions/fw1/org/corfield/framework_2_0.cfc:566):566 at fw1.org.corfield.framework_2_0_cfc$cf.udfCall(/webroot/cfextensions/fw1/org/corfield/framework_2_0.cfc):-1 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:214):214 at railo.runtime.type.UDFImpl._call(UDFImpl.java:418):418 at railo.runtime.type.UDFImpl.call(UDFImpl.java:383):383 at railo.runtime.ComponentImpl._call(ComponentImpl.java:609):609 at railo.runtime.ComponentImpl._call(ComponentImpl.java:496):496 at railo.runtime.ComponentImpl.call(ComponentImpl.java:1794):1794 at railo.runtime.listener.ModernAppListener.call(ModernAppListener.java:347):347 at railo.runtime.listener.ModernAppListener.onError(ModernAppListener.java:334):334 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2001):2001 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1958):1958 at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:297):297 at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32 at javax.servlet.http.HttpServlet.service(HttpServlet.java:820):820 at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534):534 at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:475):475 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119):119 at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:516):516 at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226):226 at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929):929 at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403):403 at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184):184 at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864):864 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117):117 at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:285):285 at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:116):116 at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:532):532 at javax.servlet.http.HttpServlet.service(HttpServlet.java:707):707 at javax.servlet.http.HttpServlet.service(HttpServlet.java:820):820 at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534):534 at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:475):475 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119):119 at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:516):516 at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226):226 at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929):929 at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403):403 at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184):184 at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864):864 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117):117 at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247):247 at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151):151 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114):114 at org.eclipse.jetty.server.Server.handle(Server.java:352):352 at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596):596 at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1051):1051 at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:590):590 at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:212):212 at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426):426 at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508):508 at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34):34 at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40):40 at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451):451 at java.lang.Thread.run(Thread.java:680):680