"Server.CreateObject error" when creating COM + components from classic ASP on IIS 7

I have a classic ASP application running on IIS 7 in the Windows Server 2008 R2 standard.

It worked great at one point in the day when suddenly, without any code changes, it started throwing the following error when creating an instance of the COM + component:

MyObject = Server.CreateObject("MyCustomComponent.MyCustomObject") 

Server object error 'ASP 0177: 80004005'

Server.CreateObject Error

/path/script.asp, line xx

80004005

What could be the problem? I did an internet search and found dozens of potential answers, none of which seem to have anything to do with this problem. I know that I am using the correct name for the object - it worked just recently. Nothing changed! I spent almost 2 hours trying to figure it out and came up with an empty one.

+4
source share
1 answer

Error 80004005 General Information

This error can be difficult to troubleshoot, given the wide variety of potential causes. A quick search on the Internet reveals a horde of offers.

The key aspect here to narrow down a possible problem on a reasonable list is that the code worked and suddenly started crashing without any code changes. Assuming that the basic changes in IIS or COM are not changed, this eliminates the possibility of using, for example, an incorrect class name for a component or incorrect registration of a component. Instead, you need to pay attention to some configuration of IIS and COM themselves, which may allow incompatible behavior without changing the settings.

  • View any changes to the permission of the user account for the user accessing the site, the user configured for IIS, or the user account for which the COM component is configured to impersonate itself.
  • View application pools installed for a site or application in IIS.
  • View any permission / authentication / impersonation code in your ASP code.
  • View the settings for the COM component itself.

Actual problem

Ultimately, the problem was that several IIS sites and applications, each of which in different IIS application pools, used the same COM component. This is not a problem in itself, except that the COM component was configured so that immediately one access to it could get up to 1 application pool.

The reason this page worked for a while was because it managed to capture the COM component first. Another pool of sites / pages / applications that uses the same COM component could not access it. Since the COM component was released after 3 minutes, this made it possible for another page to β€œcapture” it and prevent its use on the new page being tested.

Correction

The following are detailed instructions for increasing the COM component application pool limit in Windows Server 2008:

  • Go to Control Panel> Administrative Tools> Component Services.

  • In the tree, go to Component Services> My Computer> COM + Applications and find your custom component.

  • Right-click on the component and select "Properties".

  • On the tab of the merge and redial properties page, set the pool size to a number greater than 1 to match the number of potential application pools that will access the component at the same time, from IIS or elsewhere.

    COM + Pooling & Recycling

  • Try your webpage again and it works again!

+9
source

All Articles