Bean creation exception during init()

204 views
Skip to first unread message

Gary Tharaldson

unread,
Sep 17, 2009, 3:56:59 PM9/17/09
to ColdSpring-Users
I'm SOOOO new to coldspring and I'm hoping some of you studs can help
me out! I'm trying to simply set up a copy of the customers website
on our internal Windows 2003 server (ColdFusion 7 (for now))...and
I've had loads of mapping issues that I have gotten through, but the
latest problem has something to do with (Bean creation exception
during init() ).

Here's the guts (any help?):

The following information is meant for the website developer for
debugging purposes.

Error Occurred While Processing Request
Bean creation exception during init() of
components.factories.securityFactory
The parameter POCSERVICE to function init is required but was not
passed in.:

The error occurred in C:\tecnet\Html\AIR40Pv2\production\mappings
\coldspring\beans\DefaultXmlBeanFactory.cfc: line 539
Called from C:\tecnet\Html\AIR40Pv2\production\mappings\coldspring
\beans\DefaultXmlBeanFactory.cfc: line 337
Called from C:\tecnet\Html\AIR40Pv2\production\wwwroot
\fusebox.init.cfm: line 36
Called from C:\tecnet\Html\AIR40Pv2\production\mappings
\fusebox5\fusebox5.cfm: line 126
Called from C:\tecnet\Html\AIR40Pv2\production\wwwroot\index.cfm: line
21

537 : <cfthrow type="coldspring.beanCreationException"
538 : message="Bean creation exception during init() of
#beanDef.getBeanClass()#"
539 : detail="#cfcatch.message#:#cfcatch.detail#">
540 : </cfcatch>
541 : </cftry>



--------------------------------------------------------------------------------

Resources:
Check the ColdFusion documentation to verify that you are using the
correct syntax.
Search the Knowledge Base to find a solution to your problem.


Browser Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/
4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30;
MDDR; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Remote Address 192.168.1.48
Referrer
Date/Time 17-Sep-09 03:49 PM

Stack Trace (click to expand)
at cfDefaultXmlBeanFactory2ecfc1637825273$funcCONSTRUCTBEAN.runFunction
(C:\tecnet\Html\AIR40Pv2\production\mappings\coldspring\beans
\DefaultXmlBeanFactory.cfc:539) at
cfDefaultXmlBeanFactory2ecfc1637825273$funcGETBEAN.runFunction(C:
\tecnet\Html\AIR40Pv2\production\mappings\coldspring\beans
\DefaultXmlBeanFactory.cfc:337) at
cffusebox2einit2ecfm2127148459.runPage(C:\tecnet\Html
\AIR40Pv2\production\wwwroot\fusebox.init.cfm:36) at
cffusebox52ecfm1072147970.runPage(C:\tecnet\Html\AIR40Pv2\production
\mappings\fusebox5\fusebox5.cfm:126) at cfindex2ecfm1383736776.runPage
(C:\tecnet\Html\AIR40Pv2\production\wwwroot\index.cfm:21)


coldfusion.runtime.CustomException: Bean creation exception during init
() of components.factories.securityFactory
at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:124)
at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915)
at
cfDefaultXmlBeanFactory2ecfc1637825273$funcCONSTRUCTBEAN.runFunction(C:
\tecnet\Html\AIR40Pv2\production\mappings\coldspring\beans
\DefaultXmlBeanFactory.cfc:539)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:344)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke
(UDFMethod.java:290)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke
(UDFMethod.java:254)
at coldfusion.filter.FunctionAccessFilter.invoke
(FunctionAccessFilter.java:56)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:207)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:169)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1807)
at cfDefaultXmlBeanFactory2ecfc1637825273$funcGETBEAN.runFunction(C:
\tecnet\Html\AIR40Pv2\production\mappings\coldspring\beans
\DefaultXmlBeanFactory.cfc:337)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:344)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke
(UDFMethod.java:290)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke
(UDFMethod.java:254)
at coldfusion.filter.FunctionAccessFilter.invoke
(FunctionAccessFilter.java:56)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:207)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:169)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:194)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:146)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:1634)
at cffusebox2einit2ecfm2127148459.runPage(C:\tecnet\Html
\AIR40Pv2\production\wwwroot\fusebox.init.cfm:36)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915)
at cffusebox52ecfm1072147970.runPage(C:\tecnet\Html
\AIR40Pv2\production\mappings\fusebox5\fusebox5.cfm:126)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915)
at cfindex2ecfm1383736776.runPage(C:\tecnet\Html\AIR40Pv2\production
\wwwroot\index.cfm:21)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:
225)
at coldfusion.filter.RequestMonitorFilter.invoke
(RequestMonitorFilter.java:51)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
at coldfusion.filter.BrowserDebugFilter.invoke
(BrowserDebugFilter.java:52)
at coldfusion.filter.ClientScopePersistenceFilter.invoke
(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:
22)
at coldfusion.filter.RequestThrottleFilter.invoke
(RequestThrottleFilter.java:115)
at coldfusion.CfmServlet.service(CfmServlet.java:107)
at coldfusion.bootstrap.BootstrapServlet.service
(BootstrapServlet.java:78)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke
(JRunRequestDispatcher.java:257)
at jrun.servlet.ServletEngineService.dispatch
(ServletEngineService.java:541)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable
(JRunProxyService.java:204)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable
(ThreadPool.java:318)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable
(ThreadPool.java:426)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable
(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)



Brian Kotek

unread,
Sep 17, 2009, 5:09:53 PM9/17/09
to coldspri...@googlegroups.com
Your securityFactory bean is expecting a constructor argument named POCService. http://www.coldspringframework.org/coldspring/examples/quickstart/index.cfm?page=constructor

Gary Tharaldson

unread,
Sep 18, 2009, 9:45:57 AM9/18/09
to ColdSpring-Users
Is there mapping issue then within the coldspring framework that I
need to set? And if so...where might that be?

On Sep 17, 5:09 pm, Brian Kotek <brian...@gmail.com> wrote:
> Your securityFactory bean is expecting a constructor argument named
> POCService.http://www.coldspringframework.org/coldspring/examples/quickstart/ind...
> > ---------------------------------------------------------------------------­-----
> >        at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)- Hide quoted text -
>
> - Show quoted text -

Tony Nelson

unread,
Sep 18, 2009, 10:11:21 AM9/18/09
to coldspri...@googlegroups.com
ColdSpring appears to be running fine. You'll just need to update your bean definition for your securityFactory to be something like:

<bean id="securityFactory" class="com.security.SecurityFactory"> 
  <constructor-arg name="POCService"> 
    <ref bean="POCService" /> 
  </constructor-arg> 
</bean>

-Tony

Gary Tharaldson

unread,
Sep 18, 2009, 10:22:58 AM9/18/09
to ColdSpring-Users
I love it! We're getting somewhere! I do have this already, here's
what it looks like:

<bean id="pocService" class="components.services._pocService"
singleton="true">
<constructor-arg name="databaseConfig">
<ref bean="databaseConfig" />
</constructor-arg>
<constructor-arg name="legacyIncludesGateway">
<ref bean="legacyIncludesGateway" />
</constructor-arg>
<constructor-arg name="securityService">
<ref bean="securityService" />
</constructor-arg>
</bean>

Anything look wrong here?
> > > - Show quoted text -- Hide quoted text -

Tony Nelson

unread,
Sep 18, 2009, 10:25:15 AM9/18/09
to coldspri...@googlegroups.com
That looks fine. What does your securityFactory bean look like?

-Tony

Gary Tharaldson

unread,
Sep 18, 2009, 10:30:20 AM9/18/09
to ColdSpring-Users
The security factory looks like this:

<bean id="securityFactory"
class="components.factories.securityFactory" singleton="false">
<constructor-arg name="passwordConfig">
<ref bean="passwordConfig" />
</constructor-arg>
<constructor-arg name="databaseConfig">
<ref bean="databaseConfig" />
</constructor-arg>
<constructor-arg name="environmentConfig">
<ref bean="environmentConfig" />
</constructor-arg>
</bean>

I checked out the _pocService.cfc and I think the problem "might" lay
there (there's a series of queries contained in this CFC and I'm
guessing that if they aren't successfully connecting to the database
that no POCSERVICE is passed, check it out:

_pocSerivce.cfc:::

<cfcomponent
displayname="pocService service"
hint="I am a service component."
extends="components.framework.service">

<!--- INITIALIZATION / CONFIGURATION --->

<cffunction name="init" access="public" returntype="any"
output="false" displayname="Object Constructor" hint="I initialize a
perUser service.">
<cfargument name="databaseConfig" type="any" required="true" />
<cfargument name="legacyIncludesGateway" type="any" required="true" /
>
<cfargument name="securityService" type="any" required="true" />

<cfset setLegacyIncludesGateway(arguments.legacyIncludesGateway) />
<cfset setSecurityService(arguments.securityService) />
<cfset setDatabaseConfig(arguments.databaseConfig) />
<cfset setCache(structNew())>

<cfreturn this />
</cffunction>

<!--- PUBLIC FUNCTIONS --->

<cffunction name="userHasRole" access="public" output="false"
returntype="boolean">
<cfargument name="personnelID" type="numeric" required="true" />
<cfargument name="roleID" type="numeric" required="true" />

<cfquery name="qry" datasource="#getDatabaseConfig().getDsn()#">
SELECT COUNT(personnelId) AS hasRole
FROM per_personnelrole ppr
LEFT OUTER JOIN per_role pr ON ppr.roleId = pr.roleId
WHERE ppr.PersonnelId = <cfqueryparam cfsqltype="cf_sql_integer"
value="#arguments.personnelID#">
AND ppr.RoleId = <cfqueryparam cfsqltype="cf_sql_integer"
value="#arguments.roleID#">
</cfquery>

<cfreturn qry.hasRole />
</cffunction>

<cffunction name="getPlatformIDsByUser" access="public"
output="false" returntype="array">
<cfargument name="personnelID" type="numeric" required="true" />

<cfset var qry = getPlatformSeriesIdQueryByUser
(arguments.personnelID)>
<cfset var raw_platformIDs = valueList(qry.platformID)>
<cfset var platformIDs = "">

<!--- Return a list of unique platforms. --->
<cfloop list="#raw_platformIDs#" index="platformID">
<cfif NOT listFindNoCase(platformIDs, platformID)>
<cfset platformIDs = listAppend(platformIDs, platformID)>
</cfif>
</cfloop>

<cfreturn listToArray(platformIDs) />
</cffunction>

<cffunction name="getPlatformSeriesIDsByUser" access="public"
output="false" returntype="array">
<cfargument name="personnelID" type="numeric" required="true" />

<cfset var qry = getPlatformSeriesIdQueryByUser
(arguments.personnelID)>

<cfreturn listToArray(valueList(qry.platformSeriesID))>
</cffunction>

<cffunction name="expireCache" access="public" output="false"
returntype="void"
hint="I expire a personnelId's cached data.">
<cfargument name="personnelId" required="true" type="numeric">

<cfset c = getCache()>
<cfset structDelete(c,"personnelId#arguments.personnelId#")>
<cfset setCache(c)>

</cffunction>

<cffunction name="getFacilitatorAcList" access="public"
output="false" returntype="string"
hint="I provide a list of platformSeriesIDs associated with the
user's Airworthiness Facilitaor Role">
<cfargument name="personnelId" required="true" type="numeric">

<cfset qry = qryFacilitatorAcList(arguments.personnelId) />
<cfreturn valueList(qry.platformSeriesId) />

</cffunction>

<cffunction name="qryFacilitatorAcList" access="public"
output="false" returntype="query"
hint="I provide a query of platformSeriesID associated with the
user's Airworthiness Facilitaor Role">
<cfargument name="personnelId" required="true" type="numeric">

<cfset c = getCache()>
<cfset personnelKey = "personnelId#arguments.personnelId#" />

<!--- make sure user cache exists --->
<cfset initUserCache(arguments.personnelId)>

<!--- check cached query --->
<cfif structKeyExists(c[personnelKey],"qryFacilitatorAcList")>
<cfset qry = c[personnelKey]['qryFacilitatorAcList'] />
<cfelse>
<!--- get query from legacyIncludesGateway and store in cache --->
<cfset qry = getLegacyIncludesGateway().qryFacilitatorAcList
(arguments.personnelId)>
<cfset c[personnelKey]['qryFacilitatorAcList'] = qry />
</cfif>

<cfreturn qry />

</cffunction>

<cffunction name="getClassDeskAcList" access="public" output="false"
returntype="string"
hint="I provide a list of Aircraft IDs (platformSeriesId)
associated with the user's Airworthiness Facilitator Role">
<cfargument name="personnelId" required="true" type="numeric">

<cfset qry = qryClassDeskAcList(arguments.personnelId) />
<cfreturn valueList(qry.platformSeriesId) />

</cffunction>

<cffunction name="qryClassDeskAcList" access="public" output="false"
returntype="query"
hint="I provide a list of Aircraft IDs (platformSeriesId)
associated with the user's Airworthiness Facilitator Role">
<cfargument name="personnelId" required="true" type="numeric">

<cfset c = getCache()>
<cfset personnelKey = "personnelId#arguments.personnelId#" />

<!--- make sure user cache exists --->
<cfset initUserCache(arguments.personnelId)>

<!--- check cached query --->
<cfif structKeyExists(c[personnelKey],"qryClassDeskAcList")>
<cfset qry = c[personnelKey]['qryClassDeskAcList'] />
<cfelse>
<!--- get query from legacyIncludesGateway and store in cache --->
<cfset qry = getLegacyIncludesGateway().qryClassDeskAcList
(arguments.personnelId)>
<cfset c[personnelKey]['qryClassDeskAcList'] = qry />
</cfif>

<cfreturn qry />

</cffunction>

<cffunction name="qryCompetencyCodeList" access="public"
output="false" returntype="string"
hint="I return a list of a user's Assigned competency codes">
<cfargument name="personnelID" type="numeric" default="-1" />
<cfquery name="qry" datasource="#getDatabaseConfig().getDsn()#">
select
ved.competencyCode
from
per_personnel pp
join per_personnelrole ppr on pp.personnelId = ppr.personnelId
join per_supporteddiscipline psd on ppr.personnelroleid =
psd.personnelroleid
join val_engdiscipline ved on psd.EngDcpId = ved.EngDisciplineId
where
pp.personnelId = #arguments.personnelId#
and ppr.roleId in (3,4,81)
group by ved.competencyCode
</cfquery>

<cfreturn valuelist(qry.competencyCode)>

</cffunction>


<!--- PRIVATE FUNCTIONS --->
<!---
Function: getPlatformSeriesIdQueryByUser
Purpose: Return a query object containing a recordset having the
platformseriesid and platformmodelid
of all aircraft supported by the person identified with the
argument personnelID.
--->
<cffunction name="getPlatformSeriesIdQueryByUser" access="private"
returntype="query" output="false">
<cfargument name="personnelID" type="numeric" required="true" />

<!--- 03/10/2008, Task 1364, Fred Frazier, query rewritten for
performance gains. --->
<cfquery name="qry" datasource="#getDatabaseConfig().getDsn()#">
SELECT per_supportedaircraft.PlatformSeriesId,
val_platformseries.PlatformModelId AS platformID
FROM per_personnelrole
JOIN per_supportedaircraft ON per_supportedaircraft.personnelroleid
= per_personnelrole.personnelroleid
AND per_supportedaircraft.IsRemoved = 'N'
JOIN val_platformseries ON val_platformseries.PlatformSeriesId =
per_supportedaircraft.PlatformSeriesId
AND (val_platformseries.inactive = 'N'
OR val_platformseries.inactive IS NULL)
JOIN val_platformmodel ON val_platformmodel.PlatformModelId =
val_platformseries.PlatformModelId
WHERE per_personnelrole.personnelID = <cfqueryparam
cfsqltype="cf_sql_integer" value="#arguments.personnelID#">
AND per_personnelrole.isRemoved = 'N'
ORDER BY PlatformModel, PlatformSeries
</cfquery>

<cfreturn qry>
</cffunction>

<cffunction name="initUserCache" access="private" returntype="void"
output="false"
hint="I am a private method to initialize a user/personnel record's
cache.">
<cfargument name="personnelId" required="true" type="numeric">

<cfset c = getCache() />
<cfset personnelKey = "personnelId#arguments.personnelId#" />

<!--- check to see if user/personnel cache exists --->
<cfif not structKeyExists(c,personnelKey)>
<!--- create user/personnel cache --->
<cfset c[personnelKey] = structNew() />
</cfif>

</cffunction>

<cffunction name="setCache" access="private" returntype="void"
output="false"
hint="I am a private method to save the Cache variable to the
variables.instance scope.">
<cfargument name="cache" type="struct" required="true" />
<cfset variables.instance.cache = arguments.cache />
</cffunction>

<cffunction name="getCache" access="private" returntype="struct"
output="false"
hint="I am a private method to return the Cache variable from the
variables.instance scope.">
<cfreturn variables.instance.cache />
</cffunction>

<cffunction name="setLegacyIncludesGateway" access="private"
returntype="void" output="false"
hint="I am a private method to save the LegacyIncludesGateway
component to the variables.instance scope.">
<cfargument name="LegacyIncludesGateway" type="struct"
required="true" />
<cfset variables.instance.LegacyIncludesGateway =
arguments.LegacyIncludesGateway />
</cffunction>

<cffunction name="getLegacyIncludesGateway" access="private"
returntype="any" output="false"
hint="I am a private method to return the LegacyIncludesGateway
component from the variables.instance scope.">
<cfreturn variables.instance.LegacyIncludesGateway />
</cffunction>

<cffunction name="setSecurityService" access="private"
returntype="void" output="false"
hint="I am a private method to save the SecurityService component
to the variables.instance scope.">
<cfargument name="SecurityService" type="struct" required="true" />
<cfset variables.instance.SecurityService =
arguments.SecurityService />
</cffunction>

<cffunction name="getSecurityService" access="private"
returntype="any" output="false"
hint="I am a private method to return the SecurityService component
from the variables.instance scope.">
<cfreturn variables.instance.SecurityService />
</cffunction>

</cfcomponent>

thoughts?

On Sep 18, 10:11 am, Tony Nelson <tonynelso...@gmail.com> wrote:
> > > - Show quoted text -- Hide quoted text -

Tony Nelson

unread,
Sep 18, 2009, 10:40:10 AM9/18/09
to coldspri...@googlegroups.com
I don't think your pocService is the problem. Let's take a step back. If you look at your error it says:

Error Occurred While Processing Request
Bean creation exception during init() of components.factories.securityFactory
The parameter POCSERVICE to function init is required but was not passed in.:

This means the error isn't in your pocService, but in your securityFactory. Your securityFactory.init() is expecting a pocService argument, but you didn't pass one in.

If you look at your securityFactory, I'm guessing it looks something like:

<cfcomponent>


    <cffunction name="init" access="public" returntype="any"output="false">
        <cfargument name="pocService" type="any" required="true" />
        <cfargument name="passwordConfig" type="any" required="true" />

        <cfargument name="databaseConfig" type="any" required="true" />
        <cfargument name="environmentConfig" type="any" required="true" />

        <cfset setPOCService(arguments.pocService) />
        <cfset setPasswordConfig(arguments.passwordConfig) />
        <cfset setDatabaseConfig(arguments.databaseConfig) />
        <cfset setEnvironmentConfig(arguments.environmentConfig) />

        <cfreturn this />
   
    </cffunction>

    etc...

Right now you're only passing in 3 of the 4 arguments, missing the pocService. Try updating your bean definition to something like:


<bean id="securityFactory"class="components.factories.securityFactory" singleton="false">
    <constructor-arg name="pocService">
        <ref bean="pocService" />
    </constructor-arg>

    <constructor-arg name="passwordConfig">
        <ref bean="passwordConfig" />
    </constructor-arg>
    <constructor-arg name="databaseConfig">
        <ref bean="databaseConfig" />
    </constructor-arg>
    <constructor-arg name="environmentConfig">
        <ref bean="environmentConfig" />
    </constructor-arg>
</bean>

-Tony
Reply all
Reply to author
Forward
0 new messages