By Rupert
Posts tagged coldspring
Bean creation exception in ColdSpring
Mar 6th
I spent almost 45 minutes searching for the problem in Bean Creation in ColdSpring.
Bean creation exception in poimgr.model.service.FieldService
Invalid CFML construct found on line 23 at column 87.:ColdFusion was looking at the following text:
)
The CFML compiler was processing:
- a cfreturn tag beginning on line 23, column 18.
- a cfreturn tag beginning on line 23, column 18.
This basically means that there si a problem in FieldService at line 23!!!
1 <cfcomponent name="FieldService" displayname="FieldService" output="false"> 2 <!--- Constructor ---> 3 <cffunction name="init" access="Public" returntype="FieldService" output="false" hint="I am a new FieldService"> 4 <cfreturn> 5 </cfreturn> 6 7 </cffunction><cffunction name="setFieldBlockGateway" returntype="void" access="public" output="false"> 8 <cfargument name="fieldBlockGateway" type="poimgr.model.db.FieldBlockGateway" required="true"> 9 <cfset variables.fieldblockgateway="arguments.fieldBlockGateway"> 10 </cfset> 11 12 <cffunction name="getFieldBlockGateway" access="public" returntype="poimgr.model.db.FieldBlockGateway" output="false"> 13 <cfreturn> 14 </cfreturn> 15 16 17 </cffunction><cffunction name="getFieldBlocks" access="public" returntype="any" output="false"> 18 <cfreturn> 19 </cfreturn> 20 21 </cffunction><cffunction name="sortFieldBlocks" access="public" returntype="any" output="false"> 22 <cfargument name="columnName" type="string" required="true"> 23 <cfreturn> 24 </cfreturn> 25 26 27 28 </cfargument> </cffunction></cfargument></cffunction></cfcomponent>
Notice the “))” here…
Descriptive Error mechanisms need to be enhanced or Im just plain ol stupid.
AppTemplate Released Beta
Feb 7th
This is my beta release of apptemplate which runs ColdFusion, ColdSpring and Reactor.
To configure:
1. rename all instances of apptemplate to your “myapplication” found in the ff files;
Application.cfm:2:<cfapplication name="apptemplate" sessionmanagement="true"> build.xml:2: <property name="source" value="E:\wwwroot\apptemplate"> build.xml:3: </property><property name="target" value="E:\wwwroot\apptemplate"> build.xml:12: token="apptemplate" build.xml:13: value="apptemplate" config/ModelGlue.xml:4: <controller name="SecurityController" type="apptemplate.controller.SecurityController"> config/ModelGlue.xml:10: </controller><controller name="UserController" type="apptemplate.controller.UserController"> config/ColdSpring.xml:12: <property name="viewMappings"><value>/apptemplate/views</value></property> config/ColdSpring.xml:13: <property name="generatedViewMapping"><value>/apptemplate/views/generated</value></property> config/ColdSpring.xml:27: <constructor -arg name="pathToConfigXml"><value>/apptemplate/config/Reactor.xml</value></constructor> config/ColdSpring.xml:28: <property name="project"><value>apptemplate</value></property> config/ColdSpring.xml:29: <property name="dsn"><value>apptemplate</value></property> config/ColdSpring.xml:31: <property name="mapping"><value>/apptemplate/model/data</value></property> config/ColdSpring.xml:48: <bean id="dataAccess" class="apptemplate.model.db.DataAccess" singleton="true"> config/ColdSpring.xml:53: <value>apptemplate</value> config/ColdSpring.xml:57: </bean><bean id="utility" class="apptemplate.model.ValidationUtility" singleton="true"></bean> config/ColdSpring.xml:62: <bean id="userGateway" class="apptemplate.model.db.UserGateway" singleton="true" autowire="byName"></bean> config/ColdSpring.xml:64: <bean id="userDAO" class="apptemplate.model.db.UserDAO" singleton="true" autowire="byName"></bean> config/ColdSpring.xml:66: <bean id="securityService" class="apptemplate.model.service.SecurityService" singleton="true"></bean> config/ColdSpring.xml:68: <bean id="userService" class="apptemplate.model.service.UserService" singleton="true"> controller/UserController.cfc:3: <cffunction name="init" returntype="apptemplate.controller.UserController" access="public" output="false"> controller/UserController.cfc:11: <cfargument name="userService" type="apptemplate.model.service.UserService" required="true"> controller/UserController.cfc:15: <cffunction name="getUserService" returntype="apptemplate.model.service.UserService" access="public" output="false"> controller/SecurityController.cfc:3: </cffunction><cffunction name="init" returntype="apptemplate.controller.SecurityController" access="public" output="false"> controller/SecurityController.cfc:11: <cfargument name="securityService" type="apptemplate.model.service.SecurityService" required="true"> controller/SecurityController.cfc:15: <cffunction name="getSecurityService" returntype="apptemplate.model.service.SecurityService" access="public" output="false"> controller/SecurityController.cfc:20: <cfargument name="userService" type="apptemplate.model.service.UserService" required="true"> controller/SecurityController.cfc:24: <cffunction name="getUserService" returntype="apptemplate.model.service.UserService" access="public" output="false"> model/service/SecurityService.cfc:3: </cffunction><cffunction name="init" returntype="apptemplate.model.service.SecurityService" access="public" output="false"> model/service/UserService.cfc:8: <cfargument name="userGateway" type="apptemplate.model.db.UserGateway" required="true"> model/service/UserService.cfc:12: <cffunction name="getUserGateway" access="public" returntype="apptemplate.model.db.UserGateway" output="false"> model/service/UserService.cfc:17: <cfargument name="userDAO" type="apptemplate.model.db.UserDAO" required="true"> model/service/UserService.cfc:21: <cffunction name="getUserDAO" access="public" returntype="apptemplate.model.db.UserDAO" output="false"> model/db/UserDAO.cfc:1:<cfcomponent name="UserDAO" displayname="UserDAO" extends="apptemplate.model.db.DataAccess" output="false"> model/db/UserGateway.cfc:1:</cfcomponent><cfcomponent name="UserGateway" displayname="UserGateway" extends="apptemplate.model.db.DataAccess" output="false"> </cfcomponent></cffunction></cfargument></cffunction></cfargument></cffunction></cfargument></cffunction></cfargument></cffunction></cfargument></cffunction></bean></controller></property></cfapplication>
2. Create the database w/c runs on MySQL 5 and is found on
apptemplate/
db/
3. If you want to reload all classes, append “init” on the URL string.
ColdSpring bean creation magic…
Feb 1st
Adam describes some fun and exciting changes in ModelGlue Unity. I can now ditch cflocation by using argument.event.forward(“location.cfm”).
Its just now that im loving ColdSpring, I think its much better to instantiate beans and set/create other objects using setters/getters through the property instead of constructor-arg. Here’s an example:
<cfcomponent displayname="UserService" output="false" hint="I am a UserService."> <cffunction name="init" access="Public" returntype="UserService" output="false" hint="I am a new UserService"> <cfreturn> </cfreturn> </cffunction><cffunction name="setUserGateway" returntype="void" access="public" output="false" hint="Dependency: UserService"> <cfargument name="userGateway" type="cfcodetrack.model.UserGateway" required="true"> <cfset variables.usergateway="arguments.userGateway"> </cfset> <cffunction name="getUserGateway" access="public" returntype="cfcodetrack.model.UserGateway" output="false"> <cfreturn> </cfreturn> </cffunction><cffunction name="authenticate" access="public" returntype="string" output="false"> <cfargument name="username" type="string" required="true"> </cfargument><cfargument name="password" type="string" required="true"> <cfdump var="#password#"> <cfabort> </cfabort> <cffunction name="getUsers" access="public" returntype="any" output="false"> <cfreturn> </cfreturn> </cffunction> </cfdump></cfargument></cffunction></cfargument></cffunction></cfcomponent>
In your ColdSpring.xml your beans should only look like this:
<bean id="dsn" class="cfcodetrack.model.dsn"> <constructor -arg name="dsn"> <value>cfcodetrack</value> </constructor> </bean> <bean id="reactorFactory" class="reactor.reactorFactory"> <constructor -arg name="configuration"> <ref bean="reactorConfiguration"> </ref> </constructor> <!-- Security Service --> </bean><bean id="securityService" class="cfcodetrack.model.SecurityService" singleton="true"></bean> <bean id="userGateway" class="cfcodetrack.model.UserGateway" singleton="true"> <property name="reactorFactory"> <ref bean="reactorFactory"> </ref> </property><property name="dsn"> <ref bean="dsn"> </ref> </property> </bean><bean id="userService" class="cfcodetrack.model.UserService" singleton="true"> <property name="userGateway"> <ref bean="userGateway"> </ref> </property> </bean>
Comments