OK I think I found the issue....
When a parent exists, singletonCacheContainsBean will always ask the parent if the bean exists, therefore if it does not exist in the parent, singletonCacheContainsBean will return false, even though the bean really exists in the child cache.

<cffunction name="singletonCacheContainsBean" access="public" returntype="boolean" output="false">
        <cfargument name="beanName" type="string" required="true" />
        <cfset var objExists = 0 />
        <cflock name="SingletonCache" type="readonly" timeout="5">
                <cfset objExists = StructKeyExists(variables.singletonCache, beanName) />
        </cflock>
Current
<cfif objExists AND isObject(parent)>
Fix
<cfif (NOT objExists) AND isObject(parent)>
                <cfset objExists = parent.singletonCacheContainsBean(arguments.beanName)>
        </cfif>
        <cfreturn objExists />
</cffunction>




Best Regards,

Adam Crump
Sr. Analyst - Programmer
Web Services - ICS
Amkor Technology



[email protected] wrote on 03/06/2006 05:44:33 PM:

>
> And just to be safe, I just downloaded 0.5.0 Alpha and got the same results.
>
>
> Best Regards,
>
> Adam Crump
> Sr. Analyst - Programmer
> Web Services - ICS
> Amkor Technology
>
>
>
> [email protected] wrote on 03/06/2006 05:31:05 PM:
>
> >
> > Hello Kurt, I decided to perform a simpler test which uses only
> > coldspring, and still got the error.
> >
> >
> > Simple test.cfm to boil it down to just coldspring.
> > <cfset pFactory = createObject("component", "coldspring.beans.
> > DefaultXMLBeanFactory").init()>
> > <cfset pFactory.loadBeansFromXmlFile(expandPath('pServices.xml'), true)/>
> > <!--- Create applicationContext for the enterprise wide services --->
> > <cfset application.pFac = pFactory>
> >
> > <cfset cFactory = createObject("component", "coldspring.beans.
> > DefaultXMLBeanFactory").init()>
> >
> > <!--- comment it out, and no error --->
> > <cfset cFactory.setParent(application.pFac) />
> >
> > <cfset cFactory.loadBeansFromXmlFile(expandPath('cservices.xml'), true)/>
> > <!--- Create applicationContext for the enterprise wide services --->
> > <cfset cFactory.getBean("logger") />
> >
> >
> > pservices.xml
> > <?xml version="1.0" encoding="UTF-8"?>
> > <beans>
> > <!-- Utilities -->
> >         <bean id="ldapUtil" class="global.ldap.ldaputil" singleton="true" >
> >                 <constructor-arg name="ldapServerPrimary"><value>server1</
> > value></constructor-arg>
> >                 <constructor-arg name="ldapServerSecondary"><value>server2</
> > value></constructor-arg>
> >                 <constructor-arg name="ldapUserUID"><value>uname</value></
> > constructor-arg>
> >                 <constructor-arg name="ldapUserPw"><value>pw</value></
> > constructor-arg>
> >         </bean>
> > </beans>
> >
> >
> > cservives.xml
> > <?xml version="1.0" encoding="UTF-8"?>
> > <beans>    
> > <!--basic dsn settings-->
> >     <bean id="sqlDsn" class="global.dao.dsn" singleton="true"
> autowire="no">
> >                 <constructor-arg name="dsn"><value>dsnName</value></
> > constructor-arg>
> >         </bean>
> >        
> >         <bean id="as400Dsn" class="global.dao.dsn"
> singleton="true" autowire=
> > "no">
> >                 <constructor-arg name="dsn"><value>dsnName</value></
> > constructor-arg>
> >         </bean>
> >        
> > <!-- loggers and log writers -->
> >         <bean id="logger" class="global.logger.logger" singleton="true"
> > autowire="no">
> >                 <constructor-arg name="defaultWriter"><ref bean=
> > "defaultWriter"/></constructor-arg>
> >                 <constructor-arg name="activityWriter"><ref bean=
> > "defaultActivityWriter"/></constructor-arg>
> >                 <constructor-arg name="logLevel"><value>warn</value></
> > constructor-arg>
> >         </bean>
> >        
> >         <bean id="defaultWriter" class="global.logger.databaseWriter"
> > singleton="true" autowire="no">
> >                 <constructor-arg name="DSN"><ref bean="sqlDsn"/></
> > constructor-arg>
> >         </bean>
> >        
> >         <bean id="defaultActivityWriter" class="global.logger.
> > defaultActivityWriter" singleton="true" autowire="no">
> >                 <constructor-arg name="DSN"><ref bean="sqlDsn"/></
> > constructor-arg>
> >         </bean>        
> > </beans>
> >
> >
> > Debug information:
> >
> >  The following information is meant for the website developer for
> > debugging purposes.
> > Error Occurred While Processing Request
> > Cache error, sqlDsn already exists in cache
> >  
> > The error occurred in C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.
> cfc: line 550
> > Called from C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.
> cfc: line 309
> > Called from C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.
> cfc: line 262
> > Called from C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.
> cfc: line 364
> > Called from C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.
> cfc: line 262
> > Called from C:\_Web\intranet\server\wwwroot\apps\appName\index2.
> cfm: line 11
> >
> > 548 :                
> > 549 :                 <cfif error>
> > 550 :                         <cfthrow message="Cache error,
> > #beanName# already exists in cache">
> > 551 :                 </cfif>
> > 552 :         </cffunction>
> >
> > 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/5.0 (Windows; U; Windows NT 5.1; en-US;
> > rv:1.7.12) Gecko/20050915 Firefox/1.0.7
> > Remote Address           127.0.0.1
> > Referrer          
> > Date/Time           06-Mar-06 05:15 PM
> > Stack Trace
> > at
> > cfDefaultXmlBeanFactory2ecfc964161363$funcADDBEANTOSINGLETONCACHE.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:
> > 550) at cfDefaultXmlBeanFactory2ecfc964161363$funcCONSTRUCTBEAN.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:
> > 309) at cfDefaultXmlBeanFactory2ecfc964161363$funcGETBEAN.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:
> > 262) at cfDefaultXmlBeanFactory2ecfc964161363$funcCONSTRUCTBEAN.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:
> > 364) at cfDefaultXmlBeanFactory2ecfc964161363$funcGETBEAN.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:
> > 262) at cfindex22ecfm218619955.runPage(C:
> > \_Web\intranet\server\wwwroot\apps\appName\index2.cfm:11)
> >
> > coldfusion.runtime.CustomException: Cache error, sqlDsn already
> > exists in cache
> >         at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:124)
> >         at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915)
> >         at
> > cfDefaultXmlBeanFactory2ecfc964161363$funcADDBEANTOSINGLETONCACHE.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:550)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:348)
> >         at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
> >         at coldfusion.runtime.UDFMethod$ReturnTypeFilter.
> > invoke(UDFMethod.java:294)
> >         at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.
> > invoke(UDFMethod.java:258)
> >         at coldfusion.filter.FunctionAccessFilter.
> > invoke(FunctionAccessFilter.java:56)
> >         at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:211)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:173)
> >         at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1807)
> >         at cfDefaultXmlBeanFactory2ecfc964161363$funcCONSTRUCTBEAN.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:309)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:348)
> >         at coldfusion.runtime.UDFMethod$ReturnTypeFilter.
> > invoke(UDFMethod.java:294)
> >         at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.
> > invoke(UDFMethod.java:258)
> >         at coldfusion.filter.FunctionAccessFilter.
> > invoke(FunctionAccessFilter.java:56)
> >         at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:211)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:173)
> >         at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1807)
> >         at cfDefaultXmlBeanFactory2ecfc964161363$funcGETBEAN.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:262)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:348)
> >         at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
> >         at coldfusion.runtime.UDFMethod$ReturnTypeFilter.
> > invoke(UDFMethod.java:294)
> >         at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.
> > invoke(UDFMethod.java:258)
> >         at coldfusion.filter.FunctionAccessFilter.
> > invoke(FunctionAccessFilter.java:56)
> >         at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:211)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:173)
> >         at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1807)
> >         at cfDefaultXmlBeanFactory2ecfc964161363$funcCONSTRUCTBEAN.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:364)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:348)
> >         at coldfusion.runtime.UDFMethod$ReturnTypeFilter.
> > invoke(UDFMethod.java:294)
> >         at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.
> > invoke(UDFMethod.java:258)
> >         at coldfusion.filter.FunctionAccessFilter.
> > invoke(FunctionAccessFilter.java:56)
> >         at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:211)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:173)
> >         at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1807)
> >         at cfDefaultXmlBeanFactory2ecfc964161363$funcGETBEAN.
> > runFunction(C:
> > \_Web\default\extensions\coldspring\beans\DefaultXmlBeanFactory.cfc:262)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:348)
> >         at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
> >         at coldfusion.runtime.UDFMethod$ReturnTypeFilter.
> > invoke(UDFMethod.java:294)
> >         at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.
> > invoke(UDFMethod.java:258)
> >         at coldfusion.filter.FunctionAccessFilter.
> > invoke(FunctionAccessFilter.java:56)
> >         at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:211)
> >         at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:173)
> >         at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:192)
> >         at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:145)
> >         at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:1634)
> >         at cfindex22ecfm218619955.runPage(C:
> > \_Web\intranet\server\wwwroot\apps\appName\index2.cfm:11)
> >         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:209)
> >         at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
> >         at coldfusion.filter.ExceptionFilter.
> invoke(ExceptionFilter.java:69)
> >         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$ThreadThrottle.
> > invokeRunnable(ThreadPool.java:426)
> >         at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
> >
> >
> >
> >
> > Best Regards,
> >
> > Adam Crump
> > Sr. Analyst - Programmer
> > Web Services - ICS
> > Amkor Technology
> >
> >
> >
> > [email protected] wrote on 03/06/2006 05:00:26 PM:
> >
> > > Adam,
> > >
> > > Can you post a stack trace and snippets from your bean config xml files?
> > >
> > > Thanks,
> > >
> > > --Kurt
> >
> > > On 3/6/06, Adam Crump < [EMAIL PROTECTED]> wrote:
> > >
> > > I am attempting to use the parentBeanFactoryKey parameter in the
> > > coldspring machii plugin.  When I do this, I get the following error
> > > Cache error, sqlDsn already exists in cache.  I have checked both
> > > the parent bean xml and the "child" bean xml, and that bean id is
> > > only in the parent.  Any clue as to what is freaking it out?
> > >
> > >
> > > Best Regards,
> > >
> > > Adam Crump
> > > Sr. Analyst - Programmer
> > > Web Services - ICS
> > > Amkor Technology

Reply via email to