AutomationException: 0x80040259 on COM call

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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,...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139