-
assigned issue to
IBM HTTP instance for Node JS 8
We need to create IBM HTTP server instance for Node JS 8 please advise how to do it.
Comments (64)
-
-
Are you asking about how to create an instance of the builtin Apache server (administered through HTTPAdmin) for Node js?
-
Account Deactivated If you want to use the IBM HTTP server instance as a front-end and forward requests to the back-end Node.js applications. You can use the FastCGI addon to connect them. There is an article for that but I can not find the English version right now.
If you want to create a Node.js HTTP server instance from the WebAdmin GUI, it is not supported yet.
-
Dear Xu Meng I am looking for article on below link which I am not able to found if you know how to do that please write down the steps for me I want to run Node.js 8 with IBM HTTP Server for i thanks & Regards.
Running Node.js with IBM HTTP Server for i
-
I could not understand the Chinese if you can translate it in English for me it is great help I don't know why IBM is remove English version of this article.
-
Please also let me know how to install FastCGI addon.
-
how to install node-fastcgi for Node JS 8
-
Account Deactivated @sheikhifti , we can call
npm install node-fastcgi
to install node-fastcgi for Node.js 8/10.I am trying to draft an example for that.
-
npm install node-fastcgi
[K [?25h [37;40mnpm [0m [0m [30;43mWARN [0m [35m [0m nodejs_expressjs@1.0.0 No descriptionfastcgi@1.3.3~postinsta [0m [K [K
[0m [37;40mnpm [0m [0m [30;43mWARN [0m [35m [0m nodejs_expressjs@1.0.0 No repository field.
[0m
+ node-fastcgi@1.3.3
updated 1 package in 6.716s
Where it will be located -
Please send me the example how to run Node JS 8 on HTTP IBM i Server I am waiting for your reply.
-
Account Deactivated I drafted an example project -- https://github.com/IBM/ibmi-oss-examples/tree/master/nodejs/node_fastcgi
You need to clone the project to your IBM i system (e.g. /home/youname/node_fastcgi) and follow the README to setup the environment.
-
I could not see any button to download or clone the project please advise how can I put it in IBM i System.
-
Account Deactivated If you have
git
installed, you can rungit clone git@github.com:IBM/ibmi-oss-examples.git
in PASE and then you will get the whole ibmi-oss-example project. And then you cancd ibmi-oss-examples/nodejs/node_fastcgi
Otherwise you need to install git first --
yum install git
-
Thanks a lot I will do this example and let you know.
-
I have install node-fastcgi in the location "/QOpenSys/pkgs/lib/nodejs8/lib/node_modules/node-fascgi" and provided example is in the folder "/home/iftikhar/node_fastcgi" need to change any thing in the provided example please advise.
-
I am getting the below error while running the index.js please advise.
node index.js
module.js:550
throw err;
^Error: Cannot find module 'node-fastcgi'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/iftikhar/node_fastcgi/index.js:3:14) at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
$
node index.js
module.js:550
throw err;
^Error: Cannot find module '/QOpenSys/pkgs/lib/nodejs8/lib/node_modules/node-fascgi'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/iftikhar/node_fastcgi/index.js:3:14)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
$ -
Account Deactivated Did you run the command
npm i
in the project directory? This should install all the dependencies in current directory and then index.js can automatically find them usingrequire('node-fastcgi')
It is not recommended to install any addon to the global path
/QOpenSys/pkgs/lib/nodejs8/lib/node_modules/
. If you insist, you may try to runexport NODE_PATH=/QOpenSys/pkgs/lib/nodejs8/lib/node_modules
first, and then index.js should find it usingrequire('node-fastcgi')
. -
Thanks it is working now after installing all the dependencies now what is the setup for to develop new Node JS 8 application where to put the code JS, htm and hbc etc how it will run on that HTTP server what will be the path and root directory.
-
Account Deactivated Do you mean how to setup the front-end HTTP Server instance? I think it is already described here.
-
No it setup already I want to know where can I put my Node JS application code (JS, html, hbs) need to run on that front end HTTP server.
-
Account Deactivated The html files are located in the htdocs folder (e.g. /www/fastcgi/htdocs) and only the front-end HTTP server can access them.
The js code are located in the node.js project folder (e.g. /home/iftikhar/node_fastcgi) and only the back-end Node.js server can access them.
It depends on which requests you want be handled by the front-end and which are handled by the back-end.
-
When I stop the index.js then application is not running how can we keep it running without interactive session I am running it from qshell when I exit from qshell it ended the index.js and application is giving error but server is continue to run. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
Contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
-
Account Deactivated I think you can try to run this CL command to submit a job running in background --
SBMJOB CMD(QSH CMD('/QOpenSys/pkgs/bin/node /home/iftikhar/node_fastcgi/index.js'))
If you want to check / end the job, you can call
wrkactjob sbs(qbatch)
and find thePGM-node
job.Opt Subsystem/Job User Type CPU % Function Status QBATCH QSYS SBS .0 DEQW QDFTJOBD XUMENG BCH .0 CMD-QSH TIMW QP0ZSPWP XUMENG BCI .0 PGM-node SELW QZSHSH XUMENG BCI .0 PGM-QZSHSH EVTW
-
If we did changes in the application to take affect these changes we need to End this job and re-run again or just restart the server.
-
Account Deactivated If you only changed the js code, you do not need to restart the HTTP server. Just re-run the Node.js job.
-
It means that we need to end and re-run the above submitted job every time after changing the js code it is not possible that it will automatically detected the change using nodemon.
-
Account Deactivated You can find my latest reply in the discussion of that (https://bitbucket.org/ibmi/opensource/issues/45/nodemon-on-ibm-i)
/QOpenSys/pkgs/lib/nodejs8/bin/nodemon -L index.js
I have not tried to submit a nodemon job in batch mode. But you can try it.
-
when we submit the node js and its running in batch job and then run the index.html it gives the server internal error and the node js submitted job is ended itself.
-
-
I remember when I configure the server for Node JS 6 I didn't run the any node js job only configure the HTTP server and modify the few conf files.
-
when node js job running interactive it is working but in batch job it is not working.
-
Yes I have check I have run node js job also for Node JS 6. but here problem is that when we running the node js job in batch it is not working please advise.
-
Account Deactivated If you run HTTP server and Node.js server at the same system, you may try to use the
Local Mode
.In this mode, the Node.js server instance will be invoked by the HTTP server automatically.
Follow the same steps of
remote mode
to set up the environment.That means you already have the HTTP server instance
FASTCGI
and the Node.js project (/home/iftikhar/node_fastcgi) ready. Do not forget to runnpm i
to install the dependencies.Give HTTP server authority to access your Node.js code
CHGOWN OBJ('/home/iftikhar/node_fastcgi') NEWOWN(QSYS) SUBTREE(*ALL) CHGAUT OBJ('/home/iftikhar/node_fastcgi') USER(QTMHHTTP) DTAAUT(*RX) SUBTREE(*ALL)
Change
index.js
to listen to stdin (local mode)fcgiServer.listen(); //Local mode // fcgiServer.listen(8088); //Remote mode
Change
fastcgi.conf
to disableremote mode
and enablelocal mode
. And specify the path of yourindex.js
correctly.; Local Mode --the HTTP server should run at the same IP address with the FastCGI server. Server type="application/x-httpd-javascript" CommandLine="/www/fastcgi/conf/index.js" StartProcesses="1" ; Remote Mode --the FastCGI server can run at different IP addresses. Set 'Binding=' to the IP/port that the FastCGI server listens to. ; ExternalServer type="application/x-httpd-javascript" Binding="127.0.0.1:8088" ConnectionTimeout="300" RequestTimeout="300" ; Where to place socket files IpcDir /www/fastcgi/logs
Then you do not need to manually call
node index.js
to start the Node.js server. You just need to start the HTTP server and submit a HTTP request. The Node.js server will be launched automatically. -
I have run the npm i and all the dependencies are installed in project directory I have performed all the above steps but when I start the HTTP server it not starting showing still stop status I have tried several time but HTTP server not getting started please advise.
-
Please help we are stuck here.
-
Please advise where to check I didn't found any thing where is going wrong.
-
Dear Xu Meng I have enables the multithread then server start running normal but when I have submitted HTTP request is not giving the correct value please see attached.
[Fri Apr 26 12:07:21.370024 2019] [core:error] [pid 5889175:tid 0000003F] [client 10.6.227.35:57620] ZSRV_MSG0016: URI in request GET /favicon.ico HTTP/1.1 is not valid, referer: http://10.200.65.227:8383/dspsysval.jsx?key=QDAY [Fri Apr 26 12:07:55.155424 2019] [mpm_worker:notice] [pid 5889172:tid 000001CE] ZSRV_MSG0385: Apache/2.4.20 (IBM i) configured -- resuming normal operations.
After giving the HTTP request. http://10.200.65.227:8383/dspsysval.jsx?key=QDATETIME QDATETIME = undefined
-
It is running as shown below it is correct or not. Subsystem/Job User Type CPU % Function Status FASTCGI QTMHHTTP BCH .0 PGM-QZHBMAIN SIGW
FASTCGI QTMHHTTP BCI .0 PGM-QZSRLOG SIGW
FASTCGI QTMHHTTP BCI .0 PGM-QZSRLOG SIGW
FASTCGI QTMHHTTP BCI .0 PGM-QZSRHTTP SIGW
FASTCGI QTMHHTTP BCI .0 PGM-zfcgi SELW
FASTCGI QTMHHTTP BCI .2 PGM-node SELW
FASTCGI QTMHHTTP BCI .3 PGM-QZSRHTTP SIGW FASTCGI QTMHHTTP BCI .0 PGM-zfcgi FASTCGI QTMHHTTP BCI .9 PGM-node -
it if also giving the below error log.
/www/fastcgi/logs/error_zfcgi.Q5889245
**Beginning of data**
kill(-5889246, SIGUSR1) failed - [3] No such process
*End of Data***** -
Dear Xu Meng, Please advise we appreciate your help and support.
-
I am getting the below error.
[Mon Apr 29 09:30:17.220040 2019] [core:error] [pid 5889285:tid 00000052] [client 10.6.227.35:55024] ZSRV_MSG0016: URI in request GET /favicon.ico HTTP/1.1 is not valid, referer: http://10.200.65.227:8383/dspsysval.jsx?key=QCCSID [Mon Apr 29 10:33:20.917168 2019] [core:error] [pid 5889285:tid 00000052] [client 10.6.227.35:57609] ZSRV_MSG0016: URI in request GET /favicon.ico HTTP/1.1 is not valid, referer: http://10.200.65.227:8383/dspsysval.jsx?key=QCCSID
http://10.200.65.227:8383/dspsysval.jsx?key=QDATETIME
QDATETIME = undefined
-
Please help we are stuck here.
-
Account Deactivated Would you check your fastcgi.conf to see if the CommandLine is the correct path of your index.js? I manually copied index.js to the conf folder but your index.js would not be here.
; Local Mode --the HTTP server should run at the same IP address with the FastCGI server. Server type="application/x-httpd-javascript" CommandLine="/www/fastcgi/conf/index.js" StartProcesses="1"
-
The below is the path of the Index.js
Browse : /www/fastcgi/conf/index.js
Browse : /www/fastcgi/conf/fastcgi.conf
************Beginning of data**************
; Local Mode --the HTTP server should run at the same IP address with the FastCGI server.
Server type="application/x-httpd-javascript" CommandLine="/www/fastcgi/conf/index.js" StartProcesses="1"
; Remote Mode --the FastCGI server can run at different IP addresses. Set 'Binding=' to the IP/port that the FastCGI server listens to.
; ExternalServer type="application/x-httpd-javascript" Binding="127.0.0.1:8088" ConnectionTimeout="300" RequestTimeout="300"
; Where to place socket files
IpcDir /www/fastcgi/logs
End of Data********
Server is running when we hit the url the below is coming.
http://10.200.65.227:8383/dspsysval.jsx?key=QDATETIME
QDATETIME = undefined
-
Account Deactivated If you put the index.js file to /www/fastcgi/conf/index.js, then you need to put all the other files in the same directory and rum
npm init -y
andnpm i
. Otherwise index.js can not find the dependencies. -
Account Deactivated So it is recommended to directly use the Node.js project folder (e.g. /home/name/node_fastcgi). You can change the path /home/name/node_fastcgi in below code to your real directory of the node_fastcgi project.
In this project folder, call
npm i
to install the dependencies.Give HTTP server authority to access your Node.js code
CHGOWN OBJ('/home/name/node_fastcgi') NEWOWN(QSYS) SUBTREE(*ALL) CHGAUT OBJ('/home/name/node_fastcgi') USER(QTMHHTTP) DTAAUT(*RX) SUBTREE(*ALL)
Change index.js to listen to stdin
fcgiServer.listen(); //Local mode // fcgiServer.listen(8088); //Remote mode
Change fastcgi.conf to disable remote mode and enable local mode. And specify the path of your index.js correctly.
; Local Mode --the HTTP server should run at the same IP address with the FastCGI server. Server type="application/x-httpd-javascript" CommandLine="/home/name/node_fastcgi/index.js" StartProcesses="1" ; Remote Mode --the FastCGI server can run at different IP addresses. Set 'Binding=' to the IP/port that the FastCGI server listens to. ; ExternalServer type="application/x-httpd-javascript" Binding="127.0.0.1:8088" ConnectionTimeout="300" RequestTimeout="300" ; Where to place socket files IpcDir /www/fastcgi/logs
And then start your HTTP server instance FASTCGI.
-
npm i
cd '/home/iftikhar/node_fastcgi' $ > npm i [K [?25h [27m [90m...... [0m] \ build:needle: [34;40mverb [0m [35mlinkBins [0m [ { needle: './bin/needle' } [0m [K > idb-connector@1.1.10 install /home/iftikhar/node_fastcgi/node_modules/idb-connector > node-pre-gyp install --fallback-to-build [37;40mnode-pre-gyp [0m [0m [30;43mWARN [0m [0m [35mUsing needle for node-pre-gyp https download [0m [0m[idb-connector] Success: "/home/iftikhar/node_fastcgi/node_modules/idb-connector/lib/binding/Release/node-v57-ibmi-ppc64/db2i a.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile [K [?25h [37;40mnpm [0m [0m [34;40mnotice [0m [35m [0m created a lockfile as package-lock.json. You should commit this file.[K [0m [37;40mnpm [0m [0m [30;43mWARN [0m [35m [0m node_fastcgi@1.0.0 No repository field. [0m
added 72 packages from 71 contributors in 15.539s $
-
Where to put index.html
-
http://10.200.65.227:8383/dspsysval.jsx?key=QDATETIME
after giving the URL request below error is encounter
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
-
Error Log
[Tue May 07 15:25:06.135040 2019] [mpm_worker:notice] [pid 8931034:tid 0000002F] ZSRV_MSG0385: Apache/2.4.20 (IBM i) configured -- resuming normal operations.
[Tue May 07 15:28:31.512424 2019] [zend_enabler:error] [pid 8931037:tid 00000E9C] Can not find binding for type='application/x-httpd-javascript' path='/www/fastcgi/htdocs/dspsysval.jsx' (-196583.135)
-
/www/fastcgi/conf/httpd.conf
# Configuration originally created by Create HTTP Server wizard on Wed Apr 24 10:35:39 GMT+05:00 2019
LoadModule zend_enabler_module /QSYS.LIB/QHTTPSVR.LIB/QZFAST.SRVPGM
AddType application/x-httpd-javascript .jsx
AddHandler fastcgi-script .jsx
Listen 10.200.65.227:8383
DocumentRoot /www/fastcgi/htdocs
TraceEnable Off
-
Account Deactivated You need to copy the fastcgi.conf file to /www/fastcgi/conf/
This file is not part of the Node.js project, but a configuration file of the HTTP server. It tells the HTTP server where to find the back-end application to handle FastCGI requests.
-
Account Deactivated Below are the structures of the two folders (HTTP instance and the Node.js project).
The files with marker * are the only 3 files which need your modifications.
The node_modules folder contains all the dependencies of the node_fastcgi project. You can call
npm i
in the node_fastcgi folder to get it installed./www/fastcgi |-- conf | |-- fastcgi.conf * (copied from the node_fastcgi folder) | `-- httpd.conf * |-- htdocs | `-- index.html `-- logs /home/xumeng/git/ibmi-oss-examples/nodejs/node_fastcgi/ |-- README.md |-- dspsysval.js |-- fastcgi.conf ( just a template, copy it to your HTTP conf folder) |-- index.js * |-- node_modules ( call `npm i` to get these dependencies ) | |-- bufferlist | |-- fastcgi-stream | |-- idb-connector | |-- itoolkit | |-- node-addon-api | `-- node-fastcgi |-- package-lock.json `-- package.json
All the files in the node_fastcgi folder and the fastcgi.conf file in the HTTP conf folder should be given below authorities --
CHGOWN OBJ('/home/xumeng/git/ibmi-oss-examples/nodejs/node_fastcgi/') NEWOWN(QSYS) SUBTREE(*ALL) CHGAUT OBJ('/home/xumeng/git/ibmi-oss-examples/nodejs/node_fastcgi/') USER(QTMHHTTP) DTAAUT(*RX) SUBTREE(*ALL) CHGOWN OBJ('/www/fastcgi/conf/fastcgi.conf') NEWOWN(QSYS) SUBTREE(*ALL) CHGAUT OBJ('/www/fastcgi/conf/fastcgi.conf') USER(QTMHHTTP) DTAAUT(*RX) SUBTREE(*ALL)
Object . . . . . . . . . . . . : /www/fastcgi/conf/fastcgi.conf Type . . . . . . . . . . . . . : STMF Owner . . . . . . . . . . . . : QSYS Primary group . . . . . . . . : *NONE Authorization list . . . . . . : *NONE Data --Object Authorities-- Opt User Authority Exist Mgt Alter Ref *PUBLIC *RX QSYS *RWX X X X X QTMHHTTP *RX
Object . . . . . . . . . . . . : /home/xumeng/git/ibmi-oss-examples/nodejs/node_fastcgi/ Type . . . . . . . . . . . . . : DIR Owner . . . . . . . . . . . . : QSYS Primary group . . . . . . . . : *NONE Authorization list . . . . . . : *NONE Data --Object Authorities-- Opt User Authority Exist Mgt Alter Ref *PUBLIC *RX X X X X QSYS *RWX X X X X QTMHHTTP *RX
Then you can edit the index.js file and the /www/fastcgi/conf/fastcgi.conf file to choose the running mode
And ensure that the CommandLine="/home/xumeng/git/ibmi-oss-examples/nodejs/node_fastcgi/index.js" in the /www/fastcgi/conf/fastcgi.conf file is correctly set to your node_fastcgi/index.js path.
-
Dear Xu Meng,
I have done exactly you have described but still not success below is the my structure and error log.
Work with Active Jobs after giving HTTP request.
FASTCGI QTMHHTTP BCH .1 PGM-QZHBMAIN SIGW
FASTCGI QTMHHTTP BCI .0 PGM-QZSRLOG SIGW
FASTCGI QTMHHTTP BCI .0 PGM-QZSRLOG SIGW
FASTCGI QTMHHTTP BCI .1 PGM-QZSRHTTP SIGW
FASTCGI QTMHHTTP BCI .0 PGM-zfcgi SELW
FASTCGI QTMHHTTP BCI .6 PGM-node SELW
FASTCGI QTMHHTTP BCI .1 PGM-QZSRHTTP SIGW
FASTCGI QTMHHTTP BCI .0 PGM-zfcgi SELW
FASTCGI QTMHHTTP BCI .5 PGM-node SELW
http://10.200.65.227:8383/dspsysval.jsx?key=QDATETIME
QDATETIME = undefined
/www/fastcgi/logs
[Wed May 08 11:03:43.030064 2019] [zend_enabler:notice] [pid 8931666:tid 00001496] Using [Zend Enabler module, Version 1.3.1] from [Zend Technologies Ltd.]
[Wed May 08 11:04:26.103968 2019] [mpm_worker:notice] [pid 8931660:tid 00017476] ZSRV_MSG0385: Apache/2.4.20 (IBM i) configured -- resuming normal operations.
/www/fastcgi/conf/fastcgi.conf
; Local Mode --the HTTP server should run at the same IP address with the FastCGI server.
Server type="application/x-httpd-javascript" CommandLine="/home/iftikhar/node_fastcgi/index.js" StartProcesses="1"
; Remote Mode --the FastCGI server can run at different IP addresses. Set 'Binding=' to the IP/port that the FastCGI server listens to.
; ExternalServer type="application/x-httpd-javascript" Binding="127.0.0.1:8088" ConnectionTimeout="300" RequestTimeout="300"
; Where to place socket files
IpcDir /www/fastcgi/logs
End of Data********
/home/iftikhar/node_fastcgi/index.js
#!/QOpenSys/pkgs/bin/node
const fcgi = require('node-fastcgi');
const url = require('url');
const fs = require('fs');
……………………..
……………………..
fcgiServer.listen(); //Local mode
// fcgiServer.listen(8088); //Remote mode
************End of Data********************
Project Folder:
/home/iftikhar/node_fastcgi
.gitignore STMF dspsysval.js STMF index.js STMF node_modules DIR bufferlist DIR fastcgi-stream DIR idb-connector DIR itoolkit DIR node-addon-api DIR node-fastcgi DIR package.json STMF package-lock.json STMF README.md STMF
HTTP Server Folder
/www/fastcgi
conf DIR fastcgi.conf STMF httpd.conf STMF htdocs DIR index.html STMF index_bk.html STMF logs DIR
/www/fastcgi/logs/error_zfcgi.Q8931649
************Beginning of data**************
kill(-8931650, SIGUSR1) failed - [3] No such process
************End of Data********************
-
Account Deactivated Would you check the QCCSID of your system?
dspsysval qccsid
And ensure XMLSERVICE is installed.
wrklib qxmlserv
Seems the FastCGI server is running now but there are problems during retrieving the system values.
-
Account Deactivated To verify that XMLSERVICE is working, you can create a new js file (e.g. /home/iftikhar/node_fastcgi/test.js) inside the node_fastcgi folder.
And copy one of the examples from → https://github.com/IBM/nodejs-itoolkit
And run
node /home/iftikhar/node_fastcgi/test.js
to check if it can print the expected result. -
Display System Value
System value . . . . . : QCCSID Description . . . . . : Coded character set identifier
Coded character set identifier . . . . . : 65535 1-65535
wrklib qxmlserv
Opt Library Attribute
QXMLSERV PROD
test.js code ( Example 2: Toolkit classes)
var xt = require("itoolkit"); var wk = require('itoolkit/lib/iwork'); var nt = require('itoolkit/lib/inetwork'); var conn = new xt.iConn("*LOCAL", "USERNAME", "PASSWORD"); var work = new wk.iWork(conn); var net = new nt.iNetwork(conn); work.getSysValue("QCCSID", (output) => { console.log("QCCSID = " + output); }); net.getTCPIPAttr((output) => { console.log(JSON.stringify(output, " ", 2)); });
node /home/iftikhar/node_fastcgi/test.js
QCCSID = 65535
{
"TCP/IPv4_stack_status": "1",
"How_long_active": "1142295",
"When_last_started_-_date": "20190425",
"When_last_started_-_time": "072532",
"When_last_ended_-_date": "20190424",
"When_last_ended_-_time": "202217",
"Who_last_started_-_job_name": "DSP01",
"Who_last_started_-_job_user_name": "TS6601",
"Who_last_started_-_job_number": "991746",
"Who_last_started_-_internal_job_identifier": "0",
"Who_last_ended_-_job_name": "QTCPCTL",
"Who_last_ended_-_job_user_name": "QSYS",
"Who_last_ended_-_job_number": "116261",
"Who_last_ended_-_internal_job_identifier": "0",
"Offset_to_additional_information": "140",
"Length_of_additional_information": "652",
"Limited_mode": "0",
"Offset_to_list_of_Internet_addresses": "752",
"Number_of_Internet_addresses": "2",
"Entry_length_for_list_of_Internet_addresses": "20",
"DNS_protocol": "1",
"Retries": "2",
"Time_interval": "2",
"Search_order": "1",
"Initial_domain_name_server": "1",
"DNS_listening_port": "53",
"Host_name": "HBLPRD",
"Domain_name": "HBL.COM",
"Reserved": "",
"Domain_search_list": "*DFT"
}
-
Account Deactivated Would you replace the word
QCCSID
in the Example 2: Toolkit classes withQDATETIME
?work.getSysValue("QDATETIME", (output) => { console.log("QDATETIME= " + output); });
-
Account Deactivated And the System QCCSID 65535 is not a valid value. It may cause XMLSERVICE failures. Refer to this → http://yips.idevcloud.com/wiki/index.php/IBMi/65535
The system administrator should change it to a meaningful value.
-
What would be the CCSID of index.html and dspsysval.js in my case it is 13488 and 819 respectively.
-
Then what would be the suggested CCSID of the system but it is working before.
-
Account Deactivated It depends on the CCSID of system. Mine is 37 (English).
As for the CCSID of index.html and dspsysval.js, it does not matter.
IBM i default CCSID 65535 problem
IBM i default system setting is CCSID 65535, also known as *HEX or no convert, can be one of your greatest barriers to successful IBM i modernization. Simply stated, CCSID 65535 does not work well with IBM i PASE ASCII environment, PHP, Java, Ruby, etc, therefore IBM i administrator action is required (see actions below).
DSPSYSVAL SYSVAL(QCCSID) Coded character set identifier . . . . . : 65535 1-65535
IBM i administrator actions CCSID 65535
- Best solution change system wide CCSID
CHGSYSVAL SYSVAL(QCCSID) VALUE(37) Note: 37 is example, use appropriate CCSID, anything better than 65535 - Change CCSID Apache web applications (will not fix command line)
Example is PHP, but applies to any web server. /www/zendsvr/conf/httpd.conf <-- (ILE Apache side) DefaultFsCCSID 37 CGIJobCCSID 37 Note: 37 is example, use appropriate CCSID, anything better than 65535 /www/zendsvr/conf/fastcgi.conf <-- (PASE side, SETENV each application line) CCSID=819 and LANG=C -- or -- CCSID=1208 and LANG=C Note: This file must be ASCII 819, be careful EDTF - Change CCSID user profile for DB2 connect, scripts, etc.
CHGUSRPRF USRPRF(IAM37) CCSID(37) Note: 37 is example, use appropriate CCSID, anything better than 65535 - Change CCSID specific job (not recommended)
CHGJOB JOB(836270/MYID/MYJOB) CCSID(37) Note: 37 is example, use appropriate CCSID, anything better than 65535
Questions?
- Why is CCSID 65535 rough on PASE?
PASE is an ASCII environment. ILE is an EBCDIC environment. DB2 tables are 99% EBCDIC. Data flowing between PASE and ILE or DB2, must be converted for anything to work (always). IBM i default CCSID 65535, also known as *HEX or no convert, completely shuts off IBM i natural conversions in DB2, shells, etc., and, nothing works. - Inconsistent symptoms of IBM i CCSID 65535?
Many people experience general chaos understanding ‘PASE failures’. PASE applications work, other PASE applications fail. PASE applications work in one environment and fail in another environment. Worse, unfortunately, individual IBM i applications / products have taken on CCSID 6535 problem inconsistently (works in client access, not work in PHP, etc.). A long story of CCSID 65535 woe, but have faith, 99 out of 100 times, when everything is going wrong with your PASE application(s), XMLSERVICE, PHP, Java, Ruby, Node.js, etc, real issue is default setting CCSID 65535 (*HEX).
- Best solution change system wide CCSID
-
Account Deactivated Can the test.js return the correct value of
QDATETIME
? -
- changed status to resolved
Closing as this is a request for assistance with nontrivial complexity. If you wish to pursue this further, I'd recommend professional services from one of our partners. Please contact jgorzins@us.ibm.com to discuss your options if interested.
- Log in to comment