Skip navigation
dbldutch
Currently Being Moderated

cfobject - An exception occurred when instantiating a COM object

Nov 21, 2009 11:59 AM

I'm getting the following error:

 

An exception occurred when instantiating a COM object.
The cause of this exception was that: java.lang.RuntimeException: Can not use native code: Initialisation failed.

 

1 :
2 : <cfscript>
3 :     oLoader = CreateObject("com", "easyPDF.Loader.6");
4 : </cfscript>

 

This is on a dedicated server with 64bit Windows Server 8 and 64bit ColdFusion 9.  easyPDF is a program that will convert files into PDF on the server, it is also the 64 bit version.

 

I'm not even trying to do anything but load the object and am getting the error.  I took a peek inside the registry and searched for "easyPDF.Loader" and it was found.

 

Any ideas what could be going wrong? Is there something I need to do with the CF setup or IIS to get this working?  It gives the same error with the following line of code as well.

 

<cftry>
    <cfobject type="com" action="connect" class="Word.application" name="this.wordCom" context="local">
    <cfcatch>
        <cfobject type="com" action="create" class="Word.application" name="this.wordCom" context="local">
    </cfcatch>
</cftry>

 

Any help or guidance would be great.  Is there a basic <cfobject type="com"> that should work on ANY computer without installing something that I could use to test?

 

Thanks!

 
Replies
  • Currently Being Moderated
    Mar 6, 2012 9:07 PM   in reply to dbldutch

    Have you found a fix for your issue? I'm having the same issue with getting easyPDF7 to work with CF9 ent 64bit. Some other forum comments seem to indicate that CF8 64bit and CF9 64bit do not support COM. But I havent seen anything on this from Adobe in the official documenation.

     

    FYI, I've been running cf7 32bit with easyPDF5 for several years no problem.

     

    Any help would be apreciated!

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 7, 2012 2:24 PM   in reply to aWebGuy

    This seems to be the week for COM questions. 

     

    The 64 bit versions do not support COM. There is probably something in the docs ... somewhere. The closest I have seen is this older article which states:

     

    Most of the functionality and features of ColdFusion run just fine on 64-bit platforms, however, certain features like ColdFusion COM interoperability, ... do not work on a ColdFusion 64-bit platform.

     

    Other than sticking with 32bit, you might try using a .net version instead.  A quick search of EasyPDF suggests they offer one.

     

         http://www.pdfonline.com/easypdf/sdk/programming-pdf/csharp/index.htm

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 9, 2012 12:03 AM   in reply to -==cfSearching==-

    @ -==cfSearching==-

     

    I can confirm. There were serious issues in all my COM tests on 64 bit .

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 9, 2012 5:43 AM   in reply to BKBK

    To get around this issue, I've tried accessing the COM object directly in java, dynamically compiling using javaloader 1.1. But my java class fails when I try to import any COM package. I get the error “package com.bcl.easypdf does not exist”. This leads me to beleive that the com issue originates with the version of java CF is running on.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 9, 2012 9:49 AM   in reply to aWebGuy

    I do not use easyPDF, so I am making some assumptions here ... but it sounds like what you are using is not a pure java library. If it is still dependent on COM then it will not work under any application using a 64bit jvm.

     

    This leads me to beleive that the com issue originates with the version of java CF is running on.

     

    Correct. 64bit jvm's cannot load native 32 bit dlls.

     

    Will 32-bit native code work with a 64-bit VM?

    http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#64bit_na tive_porting

     

    J-Integra (Third party library used by CF for COM interop)

    http://j-integra.intrinsyc.com/support/kb/article.aspx?id=30963

     

    Message was edited by: -==cfSearching==-

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 9, 2012 9:53 AM   in reply to BKBK

    @BKBK - Yeah, apparently it is due to jvm limitations. I do not use COM much. The few CF references I have seen refer to CF8. So while the lack of support is not new, given the general shift towards 64bit operating systems I am surprised the limitation was not mentioned more prominently in the CF9 docs, especially in the createObject section.

     

     

    -Leigh

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 15, 2012 7:17 AM   in reply to -==cfSearching==-

    Just to give everyone some closure in this matter:

     

    I've opened a case with Adobe Support. Their reply was:

     

     

    COM interoperability with CF9 is not supported on 64 bit Windows OS. This is due to the limitations imposed by JIntergra. You can find a reference for this in the following tech-note:http://helpx.adobe.com/coldfusion/kb/coldfusion-limitations-running-co ldfusion-64.html

     

    It seems that J-Integra (http://j-integra.intrinsyc.com/support/kb/article.aspx?id=30963) won't update their code libraries for 64-bit support due to lack of customer demand for this functionality. Mind you this is the newest technot I could find on the matter but it was last update in 2010. I've also emailed j-Integra sales (http://j-integra.intrinsyc.com/contact.asp) to inquire about any progress in porting over their libraries to 64-bit. Who knows, if they get enough requests...

     

    I will now try to access my COM libraries from a .NET dll and call it using cfexecute.

     

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 19, 2012 5:42 PM   in reply to aWebGuy

    It seems that J-Integra (http://j-integra.intrinsyc.com/support/kb/article.aspx?id=30963)

     

    Yep, that is the same link I posted above. But my impression was it is due to technical jvm limitations, not lack of interest.

     

     

    I will now try to access my COM libraries from a .NET dll and call it using cfexecute.

     

    So you tried calling their .net assembly from CF already (via createObject) and that did not work?

     

    Message was edited by: -==cfSearching==-

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 5:53 AM   in reply to -==cfSearching==-

    Is this still true for CF10?

     

    Are there ANY workarounds?

     

    I find it hard to believe that now that the 64 bit platform comes at the expense of COM.

     

    Can I create a 64 bit .NET step down converter?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 6:16 AM   in reply to esontag

    cf10 still relies on j-integra for COM, which is still only 32bit. Because of tight timelines, I reverted to cf9 32-bit. Note that I didn't install the 9.0.1 updater as I found posts about COM issues with this version.

     

    I didn't try the .NET route because I ran out of time.

     

    If you have time to play, I found a couple post about people getting cf to access com using the Jacob bridge: http://sourceforge.net/projects/jacob-project/. I beleive Railo also provides COM support using jacob. Another option would be to try railo.

     

    Good luck.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 13, 2012 11:42 AM   in reply to dbldutch

    Same thing happen with Coldfusion version 9,0,2,282541 32-bit.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points