Book a Demo

Author Topic: Jenkins  (Read 4266 times)

Henk Verleye

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Jenkins
« on: February 27, 2015, 09:06:54 pm »
I have a python script that creates and opens an EAP file using the Enterprise Architect's COM interface.
The script works if I launch it from the command line, or through a scheduled task. The strange thing is that it fails with an exception when I start the script from Jenkins.
The same user is used in all three cases; I was able to confirm this using the Windows TaskManager.

here is the script:
Code: [Select]
filename = 'C:\\temp\\out.eap'
import win32com.client
try:
    win32com.client.gencache.EnsureModule('{64FB2BF4-9EFA-11D2-8307-C45586000000}', 0, 2, 10)
    repository = win32com.client.Dispatch('EA.Repository')
    print 'creating file'
    repository.CreateModel(win32com.client.constants.cmEAPFromBase, filename, 0)
    print 'opening file'
    repository.OpenFile(filename)
    print 'opened file'
    repository.CloseFile()
except Exception, e:
    print e
finally:
    repository = None

This is the output on Jenkins' console:
Code: [Select]
creating file
opening file
(-2147417851, 'The server threw an exception.', None, None)

The file C:\temp\out.eap was created, and can be opened by clicking on it.

EA version is 10.0.1009

Does anybody have an idea about where to start looking?

Thanks in advance,
Henk

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Jenkins
« Reply #1 on: February 27, 2015, 09:10:13 pm »
Henk,

You need an actual logged in user to be able to run EA. Running it from a scheduled task usually doesn't work.
Check out this whitepaper from LieberLieber for a possible solution.

Geert

Henk Verleye

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Jenkins
« Reply #2 on: February 27, 2015, 09:12:50 pm »
It may be useful to add that I explicitly gave this user full permission to launch the DCOM service through
Component Services -> Console root\Component services\Computers\My Computer\DCOM Config\EA.App

The used operating system is Windows Server 2003.

Henk Verleye

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Jenkins
« Reply #3 on: February 27, 2015, 09:17:54 pm »
As I already said, running the script as an scheduled task works, probably because of the triassic Windows version (I will upgrade to a newer Windows this year, so the whitepaper will be most useful, thanks for the pointer).

Also, the file is created OK, so EA was able to start.
Only when I try to open the file, the exception happens.