Ticket #227 (closed defect: wontfix)

Opened 19 years ago

Last modified 16 years ago

ReactorAdapter Check For Reactor Not Correct

Reported by: scott.arbeitman Owned by: somebody
Priority: highest Milestone:
Version: 2.0.304 Severity: major
Keywords: ormdapater, reactor Cc:

Description

Trying to do an ExpandPath? of '/reactor' does no work if your CF setup points to a folder external to the web root as a custom tag location. Therefore, Model-Glue never finds the reactor.reactorFactory file.

More sensible would be to add a try catch to the init method: <cffunction name="init" returntype="ModelGlue?.unity.orm.ReactorAdapter?" output="true" access="public">

<cfargument name="framework" type="any" required="true" />

<cfset var tmp = "" />

<cfset var reactorFactoryExists = "" />

<!--- Does a reactor configuration exist? ---> <cftry>

<cfset tmp = arguments.framework.getNativeBean("reactorConfiguration") /> <cfcatch>

<cfset arguments.framework.setUseORMAdapter("false", "No reactorConfiguration bean is present.") />

</cfcatch>

</cftry>

<!--- Does the reactor.reactorFactory exist? ---> <cftry>

<cfset CreateObject?("component","reactor.reactorFactory") />

<cfset reactorFactoryExists = true />

<cfcatch>

<cfset reactorFactoryExists = false />

<cfset arguments.framework.setUseORMAdapter("false", "Could not create reactor.reactorFactory component.") />

</cfcatch>

</cftry>

<!--- If we're ok to load, and we can find reactor, try loading it ---> <cfif isObject(tmp) and reactorFactoryExsits>

<cftry>

<cfset variables._reactor = arguments.framework.getNativeBean("ormService") /> <cfset arguments.framework.setUseORMAdapter(true, "Loaded ReactorAdapter?") /> <cfset arguments.framework.setORMAdapterName("ModelGlue?.unity.orm.ReactorAdapter?") /> <cfcatch type="reactor.config.InvalidPathToConfig?">

<cfset arguments.framework.setUseORMAdapter("false", "No Reactor.xml file found.") />

</cfcatch> <cfcatch>

<cfif cfcatch.detail contains "Invalid Path To Config">

<cfset arguments.framework.setUseORMAdapter("false", "The Reactor.xml file specified in ColdSpring?.xml cannot be found.") />

<cfelse>

<cfrethrow />

</cfif>

</cfcatch>

</cftry>

</cfif>

<cfset variables._ormStatus = arguments.framework.getUseORMAdapter() /> <cfset variables._mdCache = structNew() />

<cfreturn this />

</cffunction>

Change History

Changed 19 years ago by joe.rinehart

  • status changed from new to closed
  • resolution set to wontfix

Unfortunately, this doesn't work either: in some cases, try/catch doesn't deal well with trying() the creation of a CFC.

If your CF install points outside of its web root for custom tag location, you'll need to create a /reactor mapping, then all should work fine.

Changed 16 years ago by cfgrok

  • milestone User Reported Issues (with full information) deleted

Milestone User Reported Issues (with full information) deleted

Note: See TracTickets for help on using tickets.