Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: koenemann on February 24, 2014, 09:58:49 pm
-
We would like to call the EA from a Jenkins build job, but that fails when creating an instance of Repository.
Stacktrace when running from DLL (unfortunately only in German):
Die COM-Klassenfactory für die Komponente mit CLSID {67F4E0FA-46A7-4255-B084-69A9433D08C3} konnte aufgrund des folgenden Fehlers nicht abgerufen werden: 80080005 Starten des Servers fehlgeschlagen (Ausnahme von HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). bei System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
bei System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
bei System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
bei System.Activator.CreateInstance(Type type, Boolean nonPublic)
Stacktrace when running from Java:
java.lang.Exception: Failed to construct object. Error code: 0x80080005
at org.sparx.Repository.comConstructor(Native Method)
at org.sparx.Repository.<init>(Repository.java:170)
The EA is installed and can be started manually with the same user the build job is running with.
Any idea what could be missing?
-
I don't have much ideas about Java, but there were some threads about creating an EA instance via Java. Try the Search button top left.
q.
-
Thanks for the quick reply.
I don't have much ideas about Java, but there were some threads about creating an EA instance via Java. Try the Search button top left.
It does work to create the Repository object when running the application manually (both via DLL and via Java). So I assume our code is fine. But it does not work inside a Jenkins build job, apparently because a COM class a CLSID that is probably from the EA interop dll is not registered. But why is that different from running it manually?
Any idea?
-
Its probably a PATH or CLASSPATH issue. Is Jenkins using the same JRE/Java instance ? Assume you have added eaapi.jar onto the classpath used by Jenkins and that SSJavaCOM.dll is on the PATH ? I typically just add the SSJavaCOM.dll to the bin folder of my JRE/Java runtime....
-
Thanks for the reply, unfortunately the classpath and library path are ok:
- eaapi.jar is on the classpath (otherwise we would not reach the constructor of the Repository class).
- SSJavaCOM.dll is on the library path, otherwise we get a java.lang.UnsatisfiedLinkError: no SSJavaCOM in java.library.path
Its probably a PATH or CLASSPATH issue. Is Jenkins using the same JRE/Java instance ? Assume you have added eaapi.jar onto the classpath used by Jenkins and that SSJavaCOM.dll is on the PATH ? I typically just add the SSJavaCOM.dll to the bin folder of my JRE/Java runtime....
-
You should in parallel contact Sparx support. Maybe they can help.
q.
-
Problems I remember for EA in a batch job.
1. No EA key - Launch EA from that user account with GUI to add a key.
2. User has no permissions to create COM objects.
-
Thanks for the reply! The user permissions were indeed wrong. More precisely, the jenkins build ran with a different user than expected which did not have the permissions.
Problems I remember for EA in a batch job.
1. No EA key - Launch EA from that user account with GUI to add a key.
2. User has no permissions to create COM objects.
-
Sorry for warming up this really old topic, but I run now into are quite similar problem.
If I refer to the last two post right before this one.
1. No EA key - Launch EA from that user account with GUI to add a key.
2. User has no permissions to create COM objects.
1. This is a "Passed". Our "Jenkins user account" has an EA license. Being logged in as that user and starting the EA GUI works without any problems.
2. This is probably a "Failed". How can I find out if the user has the right to create COM objects?
Many thanks.