From: Colin K <CK-...@im...> - 2020-05-02 00:11:30
|
Just thought I would post some notes about my recent foray into trying to solve a null pointer exception problem I have with one of my hostbyname test scripts. When using the V.308 distribution on www.netrexx.org when one compiles a .nrx file note that the eyecatcher says 3.08GA with a build date of 2019-09-06 Z:\NetRexx-3.08-GA\bin>nrc hostbyname java -cp "Z:\NetRexx-3.08-GA\lib\jansi-1.18.jar;Z:\NetRexx-3.08-GA\bin;Z:\NetRexx-3.08-GA\lib\*;;;Z:\NetRexx-3.08-GA\lib\NetRexxF.jar;." -Dnrx.compiler=ecj org.netrexx.process.NetRexxC hostbyname NetRexx portable processor 3.08-*GA* build 1,582-*20190906*-1850 Copyright (c) RexxLA, 2011,2019. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. Program hostbyname.nrx === class hostbyname === method run signals ThreadQ overrides stage.run Compilation of 'hostbyname.nrx' successful I want to see if the recent changes to RexxIO that addressed some null pointer exceptions would resolve my issues with one of my pipe test scripts which gives a null pointer exception but works fine on its own. This fails with a null pointer exception (it should fail but not with a null pointer exception): pipe (hbntest5) literal bogus.bogus | hostbyname | console | compare: compare equal /PASS/ notequal /FAIL/ | console ? literal 93.184.216.34 | compare: Z:\NetRexx-3.08-GA\bin>java hbntest5 < Input record 1: Unable to determine IP address for bogus.bogus > FAIL java.lang.NullPointerException at hostbyname.run(hostbyname.java:104) at org.netrexx.njpipes.pipes.ThreadPool.run(ThreadPool.java:76) at java.lang.Thread.run(Unknown Source) Exiting due to uncaught Exception null This works: Z:\NetRexx-3.08-GA\bin>pipc "(hbntest5a) literal bogus.bogus | hostbyname | console" ( hbntest5a ) literal bogus.bogus | hostbyname | console Z:\NetRexx-3.08-GA\bin>java hbntest5a < Input record 1: Unable to determine IP address for bogus.bogus > Interestingly all my hbntest1-4 scripts have compare filters and they work just fine. There is something about this one that causes a problem. Now hbntest5 is the first script that generates output based on a caught UnknownHostName exception but I don’t see how that would be the problem as it appears to work just fine without the compare section. Now I am not in any way git literate. I went to sourceforge.net and did a download snapshot which appeared to work. It got the master branch as of 2020-04-30 (I forgot to note the 6 digit hex number that went along with it). I reran my tests but still had the same null pointer exception problem. I looked at the source file for RexxIO and I can see the new pipeSay methods. However, I did notice one thing – the eyecatcher on a compile shows 3.08-BETA2 with a date of 2019-09-08. Z:\NetRexx-3.08-GA\bin>nrc -version java -cp "Z:\NetRexx-3.08-GA\lib\jansi-1.18.jar;Z:\NetRexx-3.08-GA\bin;Z:\NetRexx-3.08-GA\lib\*;;;Z:\NetRexx-3.08-GA\lib\NetRexxC.jar;." -Dnrx.compiler=ecj org.netrexx.process.NetRexxC -version +++ Warning: Unknown command option '-version' ignored NetRexx portable processor 3.08-*BETA2* build 1,202-*20190808*-1303 Copyright (c) RexxLA, 2011,2019. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. So I figured that I had some old code and needed to recompile/rebuild the NetRexx code from this snapshot. According to the manual (section 29.2) I should make “netrexx/netrexxc/trunk” the current directory before running the compile command. The only problem is there is no such directory in my snapshot. For fun, I made my current directory the root of the NetRexx snapshot and then ran the compile command. That seemed to work fine (other than not being able to find tools.jar). Z:\NetRexx-3.08-GA>java -jar ant/ant-launcher.jar compile Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.8.0_221\lib\tools.jar Buildfile: Z:\NetRexx-3.08-GA\build.xml prepare: . . .snip. . . compile: BUILD SUCCESSFUL Total time: 3 minutes 12 seconds Z:\NetRexx-3.08-GA> I ran another nrc but it shows the same BETA2 date eyecatcher. . . . . .and test script still failed. :-( Z:\NetRexx-3.08-GA\bin>pipc hbntest5 pipe (hbntest5 ) literal bogus.bogus | hostbyname | console | compare: compare equal /PASS/ notequal /FAIL/ | console ? literal 93.184.216.34 | compare: Z:\NetRexx-3.08-GA\bin>java hbntest5 < Input record 1: Unable to determine IP address for bogus.bogus > FAIL java.lang.NullPointerException at hostbyname.run(hostbyname.java:107) at org.netrexx.njpipes.pipes.ThreadPool.run(ThreadPool.java:60) at java.lang.Thread.run(Unknown Source) Exiting due to uncaught Exception null So – it looks like I need to spend some time and get some “git” skills under my belt. :-) Time to crack open a git book. A fun and interesting journey. Cheers Colin |