Jaa


How to Debug the Scriptor Component

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

To debug a Scriptor component (Progid = Commerce.Scriptor), you need to register it as a COM+ application, and you must enable the Microsoft Windows Just-In-Time (JIT) script debugging key in the registry.

Use one of the following two methods for debugging Scriptor pipeline components:

  1. Use this method if you are logged on to the console of the server when the pipeline is executing:

    • Register the component as a COM+ server application (out-of-process).

    • Alter the registration of the Scriptor component so that it is not pooled by COM+ object pooling.

    • Enable Just-In-Time (JIT) debugging.

    • Restart Internet Information Services (IIS) by using the IISReset command.

  2. Use this method if you are logged on to the server remotely using Terminal Services:

    • If the IIS anonymous identity is an account that can be logged on interactively, then log on using the account and set the following registry key:

      HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings\JITDebug = 1

      Otherwise, set the following registry key:

      HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script\Settings\JITDebug = 1

    • Set the application to run in low process isolation (do not use medium isolation).

    • Restart IIS by using the IISReset command.

For information about where the JITDebug registry value is located in different configurations, see https://go.microsoft.com/fwlink/?LinkId=1509.

After using the following procedures to perform the preparatory steps outlined for the appropriate method, use your favorite script debugger such as Visual Studio 2005 or Visual Studio 2008 to debug the Scriptor component. For example, add a stop statement in your script file to launch your default script debugger.

To register the Scriptor component as a COM+ server application (out-of-process)

  1. Click Start, point to Programs, point to Administrative Tools, and then click Component Services.

  2. Expand Component Services, expand Computers, and then expand My Computer.

  3. Right-click the COM+ Applications folder, point to New, and then click Application. The COM+ Application Install Wizard appears.

  4. Click Next, and then click Create an empty application.

  5. Type a name for the new application, for example, Commerce Scriptor Application.

  6. Select Server Application, and then click Next.

  7. In the Set Application Identity dialog box, accept the default setting (interactive user) if the IIS anonymous identity is an account that can be logged on interactively. Otherwise, select the appropriate user.

  8. Click Next, and then click Finish.

    Note

    If your server is running Microsoft Windows Server 2003, you must click Next twice to complete two additional steps: one step to create user roles and another step to add users to those roles.

    Note

    The COM+ application is configured with security enabled by default. This causes an "Access Denied" error when a pipeline containing a Scriptor component is executed. You need to perform the following procedure to disable security checks on the COM+ application.

To disable security checks on the COM+ application

  1. Click Start, point to Programs, point to Administrative Tools, and then click Component Services.

  2. Expand Component Services, expand Computers, expand My Computer, and then expand COM+ Applications.

  3. Right-click the System Application node, and then click Properties.

  4. On the Security tab, clear the Enforce access checks for this application check box.

  5. Click OK to apply the change.

To alter the registration of the Scriptor component so that it is not pooled by COM+ object pooling

  1. Find the following key in the registry:

    HKLM\Software\Classes\CLSID\{D48BE490-59E6-11D0-82CA-00C04FD658E9}\ImplementedCategories

  2. Remove the following subkey:

    {4CB33C86-58FA-4E10-97A8-F19AFF3B81D9}

    Aa545844.alert_caution(en-US,CS.70).gifImportant Note:

    Performing these steps makes the component nonpoolable. Remember to reset the same key when you finish debugging or performance will suffer.

To import the Scriptor component into the newly created application

  1. Click Start, point to Programs, point to Administrative Tools, and then click Component Services.

  2. Expand Component Services, expand My Computer, and then expand COM+ Applications.

  3. Right-click the Components folder, click New, and then click Component. The COM Component Install Wizard appears.

  4. Click Next, and then click Import component(s) that are already registered.

  5. Click the Choose Components to Import tab, and select Commerce.Scriptor.1.

  6. Click Next, and then click Finish. The Commerce.Scriptor.1 component appears under the Components subkey.

To enable the JIT debugging registry key

  1. If the IIS anonymous identity is an account that can be logged on interactively, then log on using the account and set the following registry key:

    1. In the registry, go to the location:

      HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings

    2. Add the DWORD value "JITDebug" = 1. If the DWORD value is already there, go to the next step.

    3. Set the key to 1 as follows:HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings\JITDebug = 1

    If the account cannot be logged on interactively, set the following value to 1:

    HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script\Settings\JITDebug = 1

    Warning

    Do not leave JIT debugging enabled on production servers that run unattended in a data center. When you enable JIT debugging, any script run-time or compile error that occurs in a Windows Script Host (WSH) script (such as the Commerce.Scriptor component) causes the server execution to stop until you dismiss the JITDebug dialog box on the server console.

  2. Set the application to run in low process isolation.

    Note

    This step only applies to classic Active Server Pages (ASP) applications running on IIS 5.0 or IIS 6.0 in IIS 5.0 isolation mode. If you are running ASP.NET or are using IIS 6.0 in native mode, the Scriptor component will be running in the Aspnet_wp.exe or W3wp.exe process.

  3. Restart IIS by using the IISReset command.

    Note

    The IISReset command is needed if you are using pooled pipelines because the pooled pipeline object caches the Scriptor component. The Scriptor component in turn caches the script engine and the script, and the script engine has already read and cached the registry key value. IISReset forces the pool to be loaded and then unloaded again.

See Also

Other Resources

Troubleshooting Pipelines