Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: darkroastjava on October 13, 2009, 03:35:01 am

Title: COM Error 0x80080005
Post by: darkroastjava on October 13, 2009, 03:35:01 am
Hello,

I have troubles using the COM interface of Enterprise Architect. After days of investigation, I seem to have found the criterion that causes the troubles to appear.

The problem is that in some uses cases, when trying to create a Repository object over the COM interface, I get a COM Error 0x80080005.

I tried with Java as well as C#. However, I found out that it only occurs when I try to run the COM client as a Windows Service, i.e. when the COM interface of EA is contacted from within a Windows Service.

I found that the error message disappears when I change the properties of the "EA.App" COM Server using DCOMCNFG such that EA is started by the "Interactive User" instead of the "Launching User". The "Interactive User" is the one currently logged on to Windows. This is not a viable solution, because I would like to execute my application as a service without having someone to be logged on.

I also tried to run the service and/or EA.App using my account. (Service: By changing the "logon" settings of the windows service. EA.App: By using DCOMCNFG and updating the properties of EA.App.) None of that helped.

Here my theory:

Enterprise Architect needs a windows shell to run. A service has no shell. Thus, providing my credentials does not help because it is not a question of which user runs EA, but whether the process running EA is provided a shell. If I set the EA.App's user to "Interactive User", then the shell of the currently logged on user is provided to EA.

Now my question:

Is there any way to circumvent or solve this, or might this even be regarded as a bug/issue which should be solved by Sparx?

Thx in advanced,
darkroastjava
Title: Re: COM Error 0x80080005
Post by: Eve on October 14, 2009, 09:04:19 am
I've come across this before.  And from (foggy) memory there was something like a permission for creating a COM object that was missing.
Title: Re: COM Error 0x80080005
Post by: mrf on October 15, 2009, 09:49:42 am
Yes, I've come across this error before too, and as Simon mentioned it does have to do with COM not being able to create objects under the Local System account that services run under by default.

As far as I can remember, we were able to overcome the issue by setting the service to run as a user. Please note, services will only run as users who have passwords - so ensure the user you configure the service to run as has one set!
Title: Re: COM Error 0x80080005
Post by: darkroastjava on October 16, 2009, 11:31:27 pm
Thank you guys. Unfortunately, as far as I can find, creating the COM object is not the problem. It is rather a timeout, and in the event log I find the following message:

Event Type:      Error
Event Source:      DCOM
Event Category:      None
Event ID:      10010
Date:            25.09.2009
Time:            08:53:56
User:            N/A
Computer: (xxxx)
Description:
The server {67F4E0FA-46A7-4255-B084-69A9433D08C3} did not register with DCOM within the required timeout.


But I guess I have managed to narrow down the problem:

I have now tried with "EA Lite", which has no license key manager, and behold, it worked!! This substantiates my suspicion.

Concerning your hints, I tried to grant the user every privilege I could imagine would help, but nothing changed the behavior.
Title: Re: COM Error 0x80080005
Post by: Frank Horn on October 17, 2009, 01:27:44 am
Maybe EA can't find the license information for the user the service is running under, and tries to open the license dialog, which, being captured in the service host, it can't. Maybe it would be enough to once run EA as the service user in a desktop session and anwser the license dialog.

It may still happen, though, that some calls to the EA API will fail because they cannot run without a dialog, but I'm not sure.
Title: Re: COM Error 0x80080005
Post by: Eve on October 19, 2009, 09:01:41 am
As I said, I'm sure I've seen exactly that error reported in the situations we have described.  It may be something different in your situation, but that error has come from not being able to create COM objects in the past.