Object required global.asa error

From DataFlex Wiki
Revision as of 15:56, 19 March 2008 by Wil (talk | contribs)
Jump to navigationJump to search

After migrating a web application from an earlier version as VDF12 you might get some error while trying to run the application for the first time. If you get an error along the lines of:

Error Type: Microsoft VBScript runtime (0x800A01A8)
Object required: 'oOrder' /Order/global.asa, line 124

or

Microsoft VBScript runtime (0x800A01F9)
Invalid or unqualified reference /Order/global.asa, line 125

I might have an answer for you.

First thing to do of course is to open the global.asa file. Our web application isn't able to map the VBscript object oOrder against our WebBusiness Process called oOrder. So we expect to find this:

<OBJECT RUNAT=Server SCOPE=Session ID=oOrder PROGID="WebAppServer.WebBusinessProcess.12.1">
</OBJECT>

and you might find this:

<OBJECT RUNAT=Server SCOPE=Session ID= PROGID="WebAppServer.WebBusinessProcess.12.1">
</OBJECT>
Watch the missing ID= bit 

or no declaration at all. Then in the Session_OnStart sub section you are likely to find this line:

.Name="oOrder"

or this one:

.Name=""

instead of this:

oOrder.Name="oOrder"

So what happened? The Studio in these days parses your sources in order to decide what to write to the global.asa file and how. In the good ol' days you would open the abdata file, search for the missing entry in question, fix it and begone with it. Now things work differently, so we need to adjust the troubleshooting steps.

Is there a problem?

First thing you should look for is any issues in the Problem Resolution Panel. verify the context menu to see that "Filter Warnings" is not checked If there are complaints in the panel fix them and try compiling afterwards.

Start out fresh

What if you still have this problem? Well it could be something else. Let's make it easier for the parser and -instead of having it merge its results into an existing global.asa- feed it with an empty one. Rename your global.asa file and copy a fresh one from your VDF .\Lib folder to your application's \AppHtml folder. Try compiling again to see it is fixed. (It probably is)

Multiple WBOs in one file

Still the same problem? Hmm.. you are not having multiple WebBusinessProcess objects in one file? If that's the case isolate them and move each WBO to its own file. Also make sure to check that your subclass settings are properly set (only if you are using these of course) under Tools > Configure Workspace.

Class definitions in WBO

Check your code to see if you have a class declaration within your WBO, The Studio's parser reports an error when it sees this construction and the Global ASA generator does not try to find the name of the WBO in this case which is why it is being set to "".

The answer is that if you take the class declaration outside of the WBO it will work.

note

Also beware that webservices no longer need an entry in the global.asa file. So if they are missing, then it is perfectly normal. Check the .wso file of the service in a texteditor if it is not working. This line might contain (the value is an actual studio metatag)

Application=RenameThisWorkspace

and should be the same as the setting in your global.asa

<snip>
...
 WebAppServerSession.Initialize("Order")
...
</snip>

so it should be:

Application=Order