com4j
  1. com4j
  2. COM4J-80

Caused by: com4j.ComException: 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp:153

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      OS: Windows 7 64-bit
      JDK: java version "1.6.0_33"
      Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
      Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

      Description

      Keep getting the below exception:

      com4j.ExecutionException: com4j.ComException: 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp:153
      at com4j.ComThread.execute(ComThread.java:203)
      at com4j.Task.execute(Task.java:25)
      at com4j.COM4J.createInstance(COM4J.java:97)
      at com4j.COM4J.createInstance(COM4J.java:72)
      at com.mercury.qualitycenter.otaclient.ClassFactory.createTDConnection(Unknown Source)
      at com.tszadel.qctools4j.clients.QcConnectionImpl.initConnection(Unknown Source)
      at com.tszadel.qctools4j.clients.QcConnectionImpl.<init>(Unknown Source)
      at com.tszadel.qctools4j.QcConnectionFactory.createConnection(Unknown Source)
      at com.dexone.test.web.driver.QCReporter.qcConnect(QCReporter.java:63)
      at com.dexone.test.web.driver.QCReporter.recordTestResults(QCReporter.java:129)
      at com.dexone.test.web.driver.CustomWebDriverExceptionListener.reportTestResult(CustomWebDriverExceptionListener.java:56)
      at com.dexone.test.web.driver.CustomWebDriverExceptionListener.onTestSuccess(CustomWebDriverExceptionListener.java:34)
      at org.testng.internal.Invoker.runTestListeners(Invoker.java:1887)
      at org.testng.internal.Invoker.runTestListeners(Invoker.java:1867)
      at org.testng.internal.Invoker.invokeMethod(Invoker.java:775)
      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:894)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1219)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: com4j.ComException: 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp:153
      at com4j.Native.createInstance(Native Method)
      at com4j.COM4J$CreateInstanceTask.call(COM4J.java:117)
      at com4j.COM4J$CreateInstanceTask.call(COM4J.java:104)
      at com4j.Task.invoke(Task.java:51)
      at com4j.ComThread.run0(ComThread.java:153)
      at com4j.ComThread.run(ComThread.java:134)

      I'm also using the latest com4j that supports 64-bit JVM. This problem does not occur using a 32-bit JVM. The com4j version is 20120426. PLEASE HELP! Let me know what you need in order to hdebug issue. I'll be happy to assist you. Thanks!

        Activity

        Hide
        mothmonsterman added a comment -

        I am having the same issue with newer java, same com4j, same os.

        Everything works splendid when running with SysWOW64\com4j-x86.dll

        C:\Users\PatrickF>java -version
        java version "1.7.0_05"
        Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
        Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)

        Java Plug-in 10.5.0.05
        Using JRE version 1.7.0_05-b05 Java HotSpot(TM) 64-Bit Server VM
        User home directory = C:\Users\PatrickF

        Show
        mothmonsterman added a comment - I am having the same issue with newer java, same com4j, same os. Everything works splendid when running with SysWOW64\com4j-x86.dll C:\Users\PatrickF>java -version java version "1.7.0_05" Java(TM) SE Runtime Environment (build 1.7.0_05-b05) Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode) Java Plug-in 10.5.0.05 Using JRE version 1.7.0_05-b05 Java HotSpot(TM) 64-Bit Server VM User home directory = C:\Users\PatrickF
        Hide
        GSREDDY302 added a comment -

        I am also getting the same issue with 64 Bit. It obsolutely worked fine for me with 32 Bit.

        com4j.ComException: 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp:153

        Do any one has any clue? Its greatly appreciated.

        Show
        GSREDDY302 added a comment - I am also getting the same issue with 64 Bit. It obsolutely worked fine for me with 32 Bit. com4j.ComException: 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp:153 Do any one has any clue? Its greatly appreciated.
        Hide
        majones713 added a comment -

        Hi Guys,

        There is no current solution as the application you are using does not support 64-bit as its a 32-bit application. I tried to hack in different ways via registry.

        Check the comments below:

        http://netheadaches.wordpress.com/2012/04/22/jacob-cant-co-create-object/

        Show
        majones713 added a comment - Hi Guys, There is no current solution as the application you are using does not support 64-bit as its a 32-bit application. I tried to hack in different ways via registry. Check the comments below: http://netheadaches.wordpress.com/2012/04/22/jacob-cant-co-create-object/
        Hide
        GSREDDY302 added a comment -

        Com4J dll is already registered. It's failing on 64 Bit. Any response in this regard is greatly appreciated. Here is the error message.

        com4j.ExecutionException: com4j.ComException: 80040154 CoCreateInstance failed :
        Class not registered : .\com4j.cpp:153
        at com4j.ComThread.execute(ComThread.java:203)
        at com4j.Task.execute(Task.java:25)
        at com4j.COM4J.createInstance(COM4J.java:97)
        at com4j.COM4J.createInstance(COM4J.java:72)

        Show
        GSREDDY302 added a comment - Com4J dll is already registered. It's failing on 64 Bit. Any response in this regard is greatly appreciated. Here is the error message. com4j.ExecutionException: com4j.ComException: 80040154 CoCreateInstance failed : Class not registered : .\com4j.cpp:153 at com4j.ComThread.execute(ComThread.java:203) at com4j.Task.execute(Task.java:25) at com4j.COM4J.createInstance(COM4J.java:97) at com4j.COM4J.createInstance(COM4J.java:72)
        Hide
        GSREDDY302 added a comment -

        Hi majones713,

        I think you also faced a similar problem. I have 32Bit API Blaise application installed on 64 Bit Windows machine. I am using COM4J(64 Bit release) to connect to the Blaise which is Com component. It fails with 'CoCreateInstance failed : Class not registered' exception as I mentioned in my previous threads. My Blaise COM application is installed in C:\Program Files(x86)\StatNeth\Blaise 4.8 Enterprise as it is 32 bit application. I am able to successfully open any Blaise files on 64 Bit machine and it is failing using Com4J.

        Any help in this regard is greatly appreciated. Thanks in advance.

        Siva

        Show
        GSREDDY302 added a comment - Hi majones713, I think you also faced a similar problem. I have 32Bit API Blaise application installed on 64 Bit Windows machine. I am using COM4J(64 Bit release) to connect to the Blaise which is Com component. It fails with 'CoCreateInstance failed : Class not registered' exception as I mentioned in my previous threads. My Blaise COM application is installed in C:\Program Files(x86)\StatNeth\Blaise 4.8 Enterprise as it is 32 bit application. I am able to successfully open any Blaise files on 64 Bit machine and it is failing using Com4J. Any help in this regard is greatly appreciated. Thanks in advance. Siva
        Hide
        egavaldo added a comment -

        Same problem here with windows 7 64 bits

        a) Java 1.6 32 bits + com4j 32 bits : OK
        b) Java 1.7 32 bits + com4j 32 bits : KO (CoCreateInstance failed : Class not registered)

        Show
        egavaldo added a comment - Same problem here with windows 7 64 bits a) Java 1.6 32 bits + com4j 32 bits : OK b) Java 1.7 32 bits + com4j 32 bits : KO (CoCreateInstance failed : Class not registered)
        Hide
        FlorianMarsch added a comment - - edited

        Hi There ,
        is there any Solution or Workaround present?
        Im using JDK 1.6.0_30 + com4j 20120426-2 + com4j-x86.dll

        Edit: Solved my Issue due to register my .dll with REGSVR32

        Show
        FlorianMarsch added a comment - - edited Hi There , is there any Solution or Workaround present? Im using JDK 1.6.0_30 + com4j 20120426-2 + com4j-x86.dll Edit: Solved my Issue due to register my .dll with REGSVR32
        Hide
        suneesh added a comment -

        Hello all ,
        I am new to this API , am trying to create an object and it was successful, but I need multiple objects, that is also possible, but I need the objects with different keys..
        public abstract class Factory {

        public static com.xxx.e4sw.easee.api.internal.gen.host.ApplicationProxy createApplicationProxy(String key) {
        return COM4J.createInstance(com.xxxx.e4sw.easee.api.internal.gen.host.ApplicationProxy.class,
        key); // key is

        {AEBD6BD5-9740-42D8-8DEB-F960A4E3EB87}

        }
        }

        my question , how to get this key dynamically ?
        if I try with different keys am getting the below discussed exception.

        Show
        suneesh added a comment - Hello all , I am new to this API , am trying to create an object and it was successful, but I need multiple objects, that is also possible, but I need the objects with different keys.. public abstract class Factory { public static com.xxx.e4sw.easee.api.internal.gen.host.ApplicationProxy createApplicationProxy(String key) { return COM4J.createInstance(com.xxxx.e4sw.easee.api.internal.gen.host.ApplicationProxy.class, key); // key is {AEBD6BD5-9740-42D8-8DEB-F960A4E3EB87} } } my question , how to get this key dynamically ? if I try with different keys am getting the below discussed exception.

          People

          • Assignee:
            kohsuke
            Reporter:
            majones713
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: