Author Topic: Excecute HTMLGenerator via Java API from outside  (Read 1837 times)

MfromMunich

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Excecute HTMLGenerator via Java API from outside
« on: December 22, 2020, 03:16:55 am »
Hello,
I used already the forum search but without the correct result.  :)
Therefore my problem:
I used the Java EA Api to write a Java program for generating/export htmls from a EA Project.
The generation works within the Server, with following structure:
-> PsExec.exe -h -s -i C:\Sparx_EA_HTMLGenerator\HTMLGeneratorUmgebung.bat

HTMLGeneratorUmgebung.bat:
Code: [Select]
"C:\Program Files (x86)\java-se-8u41-ri\bin\java" -jar "C:\Sparx_EA_HTMLGenerator\HTMLGenerator.jar" "SparxCloud;Connect=Cloud=protocol:http,address:x.xxx.xxx.xxx,port:804;Data Source=sparxdb;DSN=sparxdb;" Model "NameOfPackage" C:\xampp\htdocs\EAModel

This works local at the Server.

Now I would like to execute the HTMLGeneratorUmgebung.bat from outside of the Server, by using this commando:
psexec \\server-name.de -u url\username "C:\Sparx_EA_HTMLGenerator\HTMLGeneratorUmgebung.bat"

and I get the following error

C:\Windows\system32>"C:\Program Files (x86)\java-se-8u41-ri\bin\java" -jar "C:\Sparx_EA_HTMLGenerator\HTMLGenerator.jar" "SparxCloud;Connect=Cloud=protocol:http,address:xx.xxx.xxx.xxx,port:xxx;Data Source=sparxdb;DSN=sparxdb;" Model "NameOfPackage" C:\xampp\htdocs\EAModel
Repository: SparxCloud;Connect=Cloud=protocol:http,address:xx.xxx.xxx.xxx,port:804;Data Source=sparxdb;DSN=sparxdb;
Package:    Model
Output:     EA-Model
Lade EA-API ...
erfolgreich geladen
Íffne EA-Repository ...
java.lang.Exception: Failed to construct object. Error code: 0x80080005Konnte das Repository nicht laden: Failed to construct object. Error code: 0x80080005

        at org.sparx.Repository.comConstructor(Native Method)
        at org.sparx.Repository.<init>(Repository.java:199)C:\Sparx_EA_HTMLGenerator\HTMLGeneratorStarterManuel.bat exited on ldbv-m-a4-01.blva.bayern.de with error code 0.

I started this commando from my local pc, for generating the HTMLS.

Would be nice if someone had a similar Problem and could help me.

Best regards
Martin

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Excecute HTMLGenerator via Java API from outside
« Reply #1 on: December 22, 2020, 03:25:54 am »
Hi Martin,

The problem is that you can only use the API in an interactive session from a user that has a valid license for EA.

The EA API is a client installation API.
You can run that java program from the a client machine that has a valid EA installation (or as you did, on the server if you have installed the EA client on there as well)

Geert

MfromMunich

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Excecute HTMLGenerator via Java API from outside
« Reply #2 on: December 23, 2020, 05:58:48 am »
Thank you Geert. Helps me a lot.

Best regards and merry Christmas.

Martin