problem using Asynchronous Method Calls

For questions and postings not covered by the other forums
User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

problem using Asynchronous Method Calls

Postby ghosttie » Wed Jun 01, 2011 7:37 am

I'm trying to use Asynchronous Method Calls for the first time.

I create an instance of JadeMethodContext, call initialize, set workerAppName, call invoke and I'm getting a 31923 "Worker application is not running" exception.

The worker application is running - I can't see any reason why this isn't working.

The worker application is calling asyncInitialize in its initialization method and asyncFinalize in its finalize method.

I've tried renaming the application a couple times, I've tried running it as a server app and as a thin client app, but nothing seems to make any difference.

Does anybody with Asynchronous Method Call experience have any ideas?
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

murray
Posts: 144
Joined: Fri Aug 14, 2009 6:58 pm
Location: New Plymouth, New Zealand

Re: problem using Asynchronous Method Calls

Postby murray » Wed Jun 01, 2011 8:39 am

Use the Jade monitor to verify that the worker process is running in the same node as the main app.
Murray (N.Z.)

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: problem using Asynchronous Method Calls

Postby ghosttie » Wed Jun 01, 2011 8:57 am

Yes it is
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

murray
Posts: 144
Joined: Fri Aug 14, 2009 6:58 pm
Location: New Plymouth, New Zealand

Re: problem using Asynchronous Method Calls

Postby murray » Thu Jun 02, 2011 9:17 pm

Hi ghosttie, are you still troubleshooting this problem?
If you happen to be starting the worker process from the method that invokes JadeMethodContext::invoke(), then there may not be enough time from the execution of app.startApplication() to the call to invoke() to allow for the worker application to initialise itself. In this case you could try inserting a process.sleep() statement for to see if that helps.
(BTW, I am not an expert in Jade's Asynchronous Method Call framework: I DIY'd my own equivalents before this feature was available in Jade but am preparing to use it when required in the future).
Murray (N.Z.)

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: problem using Asynchronous Method Calls

Postby ghosttie » Thu Jun 02, 2011 10:57 pm

Yeah I still haven't got it working.

At the moment I'm not even using startApplication, I'm starting the worker application manually so it's definitely had enough time to get started.
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: problem using Asynchronous Method Calls

Postby ghosttie » Fri Jun 03, 2011 4:06 am

This is weird - I can run the Asynchronous Method Call sample fine, but my simple test doesn't work at all.

Here's what I'm doing:
  1. Create awInit on your subclass of Application and call asyncInitialize in it.
  2. Create awFinalize on your subclass of Application and call asyncFinalize in it.
  3. Create a non-gui application called AsyncWorker with awInit set as its initialize method and awFinalize set as its finalize method.
  4. Run the AsyncWorker application, without selecting Run As Server Application so it runs in the same node (assumes running thin client).
  5. Use the Monitor to check that the application is running.
  6. Create a JadeScript that creates an instance of JadeMethodContext, sets workerAppName to "AsyncWorker" and calls invoke with (global, isValidObject, null) just as a test.
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

murray
Posts: 144
Joined: Fri Aug 14, 2009 6:58 pm
Location: New Plymouth, New Zealand

Re: problem using Asynchronous Method Calls

Postby murray » Fri Jun 03, 2011 5:00 pm

OK, I've just tried exactly what you describe and it works OK for me.
The only thing I had to change was the final parameter in the call to invoke because null resulted in Error 31914 "Unsupported method parameter type". I changed it to: invoke(global, isValidObject, global) for the sake of the test. I tested it on Windows 2000 (in a VM) running Jade 6.3.08.
Here is my code.

Code: Select all

constants WORKER_APP = "AsynchMethodWorker"; vars jmc1, jmc2 : JadeMethodContext; begin create jmc1 transient; jmc1.workerAppName := WORKER_APP; jmc1.invoke( global, isValidObject, global ); jmc2 := process.waitForMethods( jmc1 ); write "result = " & jmc2.getReturnValue.Boolean.String; write jmc2.display; epilog delete jmc1; end;
To troubleshoot further you could add some code to the JadeScript, prior to the invoke call, that iterates through all processes in the node and displays their details to confirm what the script sees running:

Code: Select all

vars proc : Process; begin foreach proc in node.processes do write proc.String & " " & proc.persistentApp.name; endforeach; end;
Murray (N.Z.)

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: problem using Asynchronous Method Calls

Postby ghosttie » Sat Jun 04, 2011 2:43 am

I think I've worked out what the problem is - it doesn't like it when the application is defined in a superschema.

Thanks for your help.
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

murray
Posts: 144
Joined: Fri Aug 14, 2009 6:58 pm
Location: New Plymouth, New Zealand

Re: problem using Asynchronous Method Calls

Postby murray » Sat Jun 04, 2011 7:29 pm

I think I've worked out what the problem is - it doesn't like it when the application is defined in a superschema.
Thanks for your help.
That's OK. The devil is always in the details. ;-)
Murray (N.Z.)


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 27 guests