Book a Demo

Author Topic: Java API not working  (Read 4656 times)

neole

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Java API not working
« on: September 04, 2019, 05:30:58 pm »
I would like to use the JAVA API to read and modify modesl in Enterprise Architect.

SSJavaCOM.dll is located in my PATH as well as the eaapi.jar. Furthermore, I copied SSJavaCOM.dll to System32 and SysWOW64 folder. I use JDK 8 with 32 Bit. I also checked out the code examples provided in the software release of Enterprise Architect.

The following minimal example does not work (neither the provide Java code examples).

final org.sparx.Repository r = new org.sparx.Repository();
r.OpenFile("C:\\test.eap");

I get the following exception:

java.lang.Exception: Failed to construct object. Error code: 0x80004002
   at org.sparx.Repository.comConstructor(Native Method)
   at org.sparx.Repository.<init>(Repository.java:199)

I also tries to run the application as administator.

My environment ist

* Windows 10 Version 1709
* Enterprise Architect 14

Thank you so much for your help

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Java API not working
« Reply #1 on: September 04, 2019, 05:49:11 pm »
Honestly, if at all possible you better switch to .Net for this.
There is a lot more example code available in C# than there is in Java, and I've seen quite a lot of people struggle with the Java API.

Also you can't make add-ins with Java.

Geert