Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
override11 #1
AutomationException: 0x80040259 on COM call
I have a cfc that calls to PC*Miler using COM. Here is my cfc:
(see attached code)
I invoke this function with the following code:
<cfinvoke component="Pcmiler" method="RunMiles" returnvariable="ETA">
<cfinvokeargument name="Origin" value="#Trim(Numberformat(ContactZip,
"00000"))#">
<cfinvokeargument name="Destination" value="#Trim(Numberformat(DestZip,
"00000"))#">
</cfinvoke>
I loop through about 40 records and get a distance between each points.
Randomly I get a COM automation error that shows like this:
An exception occurred when executing a Com method.
The cause of this exception was that: AutomationException: 0x80040259 - .
AutomationException: 0x80040259 -
at com.linar.jintegra.Invoke.g(Unknown Source)
at com.linar.jintegra.Dispatch.invoke(Unknown Source)
at com.linar.jintegra.Dispatch.invokeMethodByName(Unk nown Source)
at coldfusion.runtime.com.ComProxy.invoke(ComProxy.ja va:576)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.jav a:1627)
at
cfpcmiler2ecfc727986776$funcRUNMILES.runFunction(D :\Webroot\CustomTags\pcmiler.c
fc:62)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java :348)
at coldfusion.filter.SilentFilter.invoke(SilentFilter .java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invo ke(UDFMethod.java:294)
at
coldfusion.runtime.UDFMethod$ArgumentCollectionFil ter.invoke(UDFMethod.java:258)
at coldfusion.filter.FunctionAccessFilter.invoke(Func tionAccessFilter.java:56)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMet hod.java:211)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java :370)
at coldfusion.runtime.TemplateProxy.invoke(TemplatePr oxy.java:196)
at coldfusion.runtime.TemplateProxy.invoke(TemplatePr oxy.java:156)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.jav a:1587)
at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTa g.java:341)
at
cfindex2ecfm900364699.runPage(D:\Webroot\[url]www.gaineycorp.com\Portal\CrewTrack\ind[/url]
ex.cfm:87)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java :152)
at coldfusion.tagext.lang.IncludeTag.doStartTag(Inclu deTag.java:343)
at coldfusion.filter.CfincludeFilter.invoke(Cfinclude Filter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(Applica tionFilter.java:210)
at coldfusion.filter.RequestMonitorFilter.invoke(Requ estMonitorFilter.java:51)
at coldfusion.filter.PathFilter.invoke(PathFilter.jav a:86)
at coldfusion.filter.ExceptionFilter.invoke(Exception Filter.java:50)
at coldfusion.filter.BrowserDebugFilter.invoke(Browse rDebugFilter.java:52)
at
coldfusion.filter.ClientScopePersistenceFilter.inv oke(ClientScopePersistenceFilt
er.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilt er.java:38)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilt er.java:38)
at coldfusion.filter.DatasourceFilter.invoke(Datasour ceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:105)
at coldfusion.bootstrap.BootstrapServlet.service(Boot strapServlet.java:78)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:257)
at jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:527)
at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable( JRunProxyService.java:204)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invok eRunnable(ThreadPool.java:349)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:457)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeR unnable(ThreadPool.java:295)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66)
Does anyone have any idea's on this one??
<cffunction name="RunMiles"
displayname="Simple PC*Miler Miles Calculation"
hint="This function will calculate PC*Miler miles for origin to destination
with no stops"
returntype="string" output="false">
<cfargument name="Origin" required="yes" type="string" hint="Enter a
properly formatted PC*Miler origin. examples: '49412', or 'Fremont, MI', or
'49412 Fremont, MI'">
<cfargument name="Destination" required="yes" type="string" hint="Enter a
properly formatted PC*Miler origin. examples: '49412', or 'Fremont, MI', or
'49412 Fremont, MI'">
<cfargument name="Type" type="numeric" hint="PC*Miler calculation type.
0=Practical(default) 1=Shortest 2=National Highways 3=Avoid Tolls 4=Straight
Line Air Distance 6=53' Truck Routing">
<!--- Create default type parameter --->
<cfparam name="Arguments.Type" default="0">
<!--- Value check the 'type' argument --->
<cfif Arguments.Type gt 6>
<cfreturn 'Invalid Type passed. Acceptable types are 0=Practical(default)
1=Shortest 2=National Highways 3=Avoid Tolls 4=Straight Line Air Distance 6=53
Foot Truck Routing'>
</cfif>
<!--- Create instance of image component --->
<CFSET PCMILER.ALK = CreateObject("com", "PCMServer.PCMServer") />
<!--- Validate that the origin is valid --->
<cfset ValidateO = PCMILER.ALK.CheckPlaceName("#Arguments.Origin#") />
<cfif ValidateO eq 0>
<cfscript>ReleaseComObject(PCMILER.ALK);</cfscript>
<cfreturn 'Origin was not found'>
</cfif>
<!--- Validate that the Destination is valid --->
<cfset ValidateD = PCMILER.ALK.CheckPlaceName("#Arguments.Destination #") />
<cfif ValidateD eq 0>
<cfscript>ReleaseComObject(PCMILER.ALK);</cfscript>
<cfreturn 'Destination was not found'>
</cfif>
<!--- OK, origin and destination look good, lets run these miles, based on
the argument.type, defaulting to practical --->
<cfset Miles = PCMILER.ALK.CalcDistance2("#Arguments.Origin#",
"#Arguments.Destination#", #Arguments.Type#) />
<!--- Cleanup ALK object here --->
<cfscript>ReleaseComObject(PCMILER.ALK);</cfscript>
<cfreturn '#NumberFormat(Miles / 10, "0.0")#'>
</cffunction>
override11 Guest
-
Call CSS
los CSS se pueden separar en un SWF o en un paquete distinto, as? el usuario los puede cambiarlos? The Css can be separate in a SWF or on a... -
CFC Call Hanging on Second Call
I run the flex application localy using the demo/dev server and do a search using a CFC, and then do another and its fine. But when my boss tries,... -
Can I call a CFR in a CFC
I am understand I can easily call a cfc in a cfm file and then use the cfreport tag in the cfm file to call teh template and use the query returned... -
The best way to call a cfc??
I have read a few things about how to invoke cfc's but it just seems very tidious to develop locally then when I deploy to a development server I... -
remote call procedure call failed
Also, it says error 1726 "remote call procedure call failed" Help, Unable to save username and password in XP Home edition. It allows me to... -
TomDonovan #2
Re: AutomationException: 0x80040259 on COM call
If the problem is intermittant, maybe it happens when PC*Miller objects are
created or called concurrently. There's a FAQ which might help at
[url]http://www.alk.com/support/pcmiler_connect/faqs_gen5.asp[/url].
Another thing to try is putting a named <cflock> around everything from
CreateObject to ReleaseComObject. If this makes the problem go away, you can
be pretty sure it was a concurrency problem.
Finally, ALK?s Tech Support might be able to tell you what error 0x80040259
really means.
TomDonovan Guest
-
override11 #3
Re: AutomationException: 0x80040259 on COM call
Thank you! I added a <cflock name="PcMiler" timeout="30" type="exclusive"> around my code, and all is well! Thank you sir!!!
override11 Guest



Reply With Quote

