Brad,
Nice explanation that explains how this work however the problem still isn't making sense.
The program is a websmart program and they do change the library list.Except the library list doesn't get changed until the program gets invoked.  And in this case the program is not getting invoked.

I get a dump under a separate job with two spool files QZSRHTTPTR & QPJOBLOG.
QZSRHTPPTR looks like thisUser Trace Dump for job 909364/QTMHHTTP/LP_ACCESS. Size: 300K, Wrapped 0 times.                            
--- 03/11/2016 15:31:55 ---                                                                                
        0000033F:598216 ExceptionHandler_Default(), exception occurred                                     
        0000033F:598240 F4BAC17FAF:0064F0 L:0007 zsrvhjob.c : Exception ID:                                
        0000033F:598256  F4BAC17FAF:0064F0  C3F2D4F1 F6F0F1                         *C2M1601.........*     
        0000033F:598272 F4BAC17FAF:006530 L:0030 zsrvhjob.c : Exception data:                              
        0000033F:598288  F4BAC17FAF:006530  F9F2998A 26FFDE20 00000000 00100000     *92r.............*     
        0000033F:598304  F4BAC17FAF:006540  C6E12686 C1003610 00000000 FE0F23B4     *F..fA...........*     
        0000033F:598320  F4BAC17FAF:006550  FFFFFFFF FE0D9310 00000000 00000002     *......l.........*     
                                                   TRCTCPAPP Output                                        
------------------------------

So I'm stumped as to why it sometimes executes correctly and other times not. 
And just to add a wrinkle to the picture - I have just realized the jobd for QZHBHTTP is different on production.  A whole slew of libraries has been added to it including the program in question.
I can't seem to find much info on QZHBHTTP except for warnings about changing it. But I did see the suggestion on another midrange post to add the desired library to QZHBHTTP jobd.
This still does not explain the inconsistency of the execution. 
I did resolve the problem - by combining my two ajax calls to 1.  In this case they all seem to execute correctly. Not a satisfactory resolution.And I'm still seeing this error in our logs for other executions. 
Thanks.Vicki
message: 3
date: Thu, 10 Mar 2016 13:52:23 -0600
from: Bradley Stone <bvstone@xxxxxxxxx>
subject: Re: [WEB400] 500 Error when trying to call a program with a
    service    program

Do both programs call a function in the same service program?

Do any programs you call manipulate the library list?  Maybe leaving a
library that contains the service program in the library list for one job,
while another job hasn't called a program that adds this library?

Remember that calls to the HTTP server are not always to the same job (they
are not persistent).  If you have 3 requests coming in it will be split up
(most of the time) to 3 different jobs.

So, lets say you run a CGI program from your browser.  It adds library
MYSRVPGM to the library list but does not remove it when it ends.

Now you call a CGI program (or a static page) that includes 2 AJAX calls.
Each call will most likely be run in a different job.  The first call may
get the first job (that we used earlier) and have no issues since MYSRVPGM
is in the library list.

The second call will get a different (or even newly created in some cases)
job without MYSRVPGM in the library list and crash with that error.

The idea is, don't think of web jobs as interactive green screen type
jobs.  They are "take requests as they come" and spread them out to
available jobs.  And, as before, sometimes new jobs are started depending
on your server settings.

Brad
www.bvstools.com

On Thu, Mar 10, 2016 at 1:39 PM, Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:

By default, the resolution happens when the program is
loaded(activated)...unless you have *DEFER specified for the service
program on the BNDSRVPGM() parm of CRTPGM.  Once activated, the program &
services programs remain active till the activation group is ended or
reclaimed.

Do both Ajax calls call the same program?

Do both Ajax calls make use of procedures from the ITMCHNGSRV *SRVPGM?

Charles

On Thu, Mar 10, 2016 at 2:08 PM, Vicki Wilson <victwyh@xxxxxxxxx> wrote:

Charles,
I agree it's a library list issue.  But I need to work my way back a
little to determine why the library list changed for the first ajax call
but not for the second???
I don't know the Apache config/QHTTPSVR jobs well enough to understand
why
the job gets invoked correctly on the first call but not the second.
And I
don't know where to look. Also - I realize that maybe I'm assuming that
the
binding reference is resolved every time the program is called.  I think
this is correct.
Vicki Wilson








--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.




------------------------------

Subject: Digest Footer


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.