vNo new line character after HTTP response header
vNo data after HTTP response header.
Solution: Write the data to stdout with Content-type: line with two new line
characters (\n) and the data to be returned to the client. For example:
Content-type: text/plain\n
\n
This data is returned to the client
Cause: CGI program caused an exception message that was not handled by the
CGI program.
Solution: Look at the active server job logs in Figure 1on page 139. If the system
does not indicate a message in the joblog for the active server jobs, do a WRKSPLF
QTMHHTTP. Check for server jobs that ended when the system ran the CGI
program. Change the program to monitor for the unhandled message.
Cause: The program being called does not exist in the library.
Solution: Check the library for the correct name.
Cause: There is a bug in your user-created CGI program.
Solution: You need to set up a scaffolding environment to debug the CGI
application prior to integration with server:
1. Issue the command ENDTCPSVR *HTTP HTTPSVR(server_instance)
2. Issue the command STRTCPSVR *HTTP HTTPSVR(server_instance '-minat 1
-maxat 1')
Note: You also may need to change script_timeout and output_timeout to be
larger. If you are stepping through your code, it may take too long and
script_timeout or output_timeout may expire. This causes the server to
terminate the job you are debugging.
Ending and starting the server ensures that only one worker job is running.
a. Issue the command WRKACTJOB JOB(server_instance)
Three active jobs are displayed for this server instance. The first job in the
list is always the server instance server job (Function PGM-QZHBHTTP).
The second and third jobs in the list are the CGI program jobs. One is for
single thread-capable CGI programs, and the other is for
multithread-capable CGI programs (Java).
Select option 10 to display the job log.
If your CGI program is single thread capable (not written in Java language),
message HTP2001 will be in the job log. If your CGI program is multithread
capable (Java), message HTP2002 will be in the job log.
Record the Number:,User:, and Job: values for your CGI program job.
Press F12.
Issue the command STRSRVJOB <Number/User/Job>.
b. For the user CGI program, issue the command STRDBG <usercgilib/cgipgm>
If the program accesses a database file on the AS/400, you must specify
UPDPROD(*YES). See the help for the STRDBG command.
140 WebProgramming Guide V4R5