RNX0301 in AIR07_01
Just getting started with the source code. When I try to run AIR07_01, I get an RNX0301 on this line of code:
airWorkbook = new_HSSFWorkbook();
Message ID . . . . . . : RNX0301 Severity . . . . . . . : 50Message type . . . . . : EscapeDate sent . . . . . . : 10/07/10 Time sent . . . . . . : 09:25:41Message . . . . : Java exception received when calling Java method.Cause . . . . . : RPG procedure AIR07_01 in program AIRLIB/AIR07_01 receive Java exception "java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook" when calling method "" with signature "()V" in class "org.apache.poi.hssf.usermodel.HSSFWorkbook".Recovery . . . : Contact the person responsible for program maintenance to determine the cause of the problem.Technical description . . . . . . . . : If the exception indicates that the Java class was not found, ensure the class for the method is in the class path. If the exception indicates that the Java method was not found, check the method name and signature. If the signature is not correct, change the RPG prototype for the method, or change the Java method, so that the return
type and parameter types match. You can determine the signatures for all themethods in class XYZ using command QSH CMD('javap -s XYZ').
By the way, here's the value of CLASSPATH...and yes...that's where the JAR files live:
Value . . . . . . . . . : '.:/QIBM/UserData/Java400/ext/Excel_POI/poi-3.0.2-FINAL-20080204.jar:/QIBM/UserData/Java400/ext/PDF_iText/iText-2.1.4.jar:/QIBM/UserData/Java400/ext/JavaMail/activation.jar:/QIBM/UserData/Java400/ext/JavaMail/mail.jar'
Also...I'm on V5R4M0.
I see you're using a sub directory of /QIBM/UserData/Java400/ext to place your jar files. Just for testing purposes, could you try putting the poi-3.0.2-FINAL-20080204.jar file right into the /QIBM/UserData/Java400/ext folder and don't even bother setting the classpath.
I prefer to use a designated location outside of the default for the jar files, but this process will help with determining where the problem is.
If this works, then you know there is a problem in the way the classpath is set. If it doesn't work, then there is probably another coding issue.
I moved the JARs and changed SVAIRJAVA to point to their new locations. It works now! I already had some other JARs in that directory so I'll just leave the new ones there since it works now. Thanks!!
I wrote a bit about this in the book. If you're going to put your jar files here, make sure you keep track of what you put in there. This is because IBM puts some files in there and if you are to backup and restore all the files you may overwrite some updated files that IBM provides. I was proposing this for the test, and would recommend putting it in a different location. Or you could keep track.
I've had an experience or two using IBM directories for my own files and I prefer to put my stuff in it's own place. But, I know you're probably eager to get some Excel spreadsheets and PDFs going on and you'll probably come back later