RE: Need help with RNX0301 error -- CLASSPATH or signature error
"Blalock, Bill via JAVA400-L" <[email protected]> Sun, 6 Oct 2024 18:21:46 +0000
| Newsgroups | gmane.comp.lang.as400.java |
|---|---|
| Message-ID | <PAXPR08MB723018F4D522BECB93A4D1A4837C2@PAXPR08MB7230.eurprd08.prod.outlook.com> |
PS everyone. The META-INFO folder contains the file MANIFEST.MF. MANiFEST.MF has one line, "Manifest-Version: 1.0" The URL of the example I am trying to implement is "https://www.mysamplecode.com/2011/06/call-java-from-rpgle-explanation-with.html" I haven't posted the code because it seems long. If anyone wants to take a look at it I can email to you as attachments or post it into the mailing list. Thank you all. -----Original Message----- From: JAVA400-L <[email protected]> On Behalf Of Blalock, Bill via JAVA400-L Sent: Sunday, October 6, 2024 1:12 PM To: Java Programming on and around the IBM i <[email protected]> Cc: Blalock, Bill <[email protected]> Subject: RE: Need help with RNX0301 error -- CLASSPATH or signature error Hi David, The fully qualified name of the classes I am trying to use are rpgExample.Item rpgExample.GetItem I exported these two classes in the package rpgExample to a jar file named rpgExample. To confusing? The jar file contains the two classes Item and GetItem. I tried exporting again into a clean environment. This jar is rpgExampleJar.jar. The package in the jar is rpgExamplePkg. The structure of the jar file, obtained by copying it as a zip file, is META-INFO MANIFEST.MF rpgExamplePkg Item.class GetItem.class How should I set up the CLASSPATH? Thank you for helping. -----Original Message----- From: JAVA400-L <[email protected]> On Behalf Of David Gibbs via JAVA400-L Sent: Sunday, October 6, 2024 12:31 PM To: Java Programming on and around the IBM i <[email protected]> Cc: David Gibbs <[email protected]> Subject: Re: Need help with RNX0301 error -- CLASSPATH or signature error What’s the fully qualified name of the class you’re trying to use? Fully qualified class includes package & class name. It looks like your trying to use the jar name in the class name. David IBM i on Power Systems: For when you can't afford to be out of business! I'm riding in the American Diabetes Association's Tour de Cure to raise money for diabetes research, education, advocacy, and awareness. You can make a tax-deductible donation to my ride by visiting https://mideml.diabetessucks.net/. You can see where my donations come from by visiting my interactive donation map ... https://mideml.diabetessucks.net/map (it's a geeky thing). I may have diabetes, but diabetes doesn't have me! On Sun, Oct 6, 2024 at 11:25 AM Blalock, Bill via JAVA400-L < [email protected]> wrote: > I am trying to call Jave from RPGLESRC. I keep running into RNX0301 > when executing the RPGLE program. I have been at it 3 days and sure > could use some guidance. > > Message . . . . : Java exception received when calling Java method. > Cause . . . . . : RPG procedure PRCPWDIRG in program BLALOCK/PRCPWDIRG > received Java exception > "java.lang.NoClassDefFoundError:rpgExample.Item" when calling > method "<init>" with signature "()V" in class "Item". > > I tried for two days to get past this error with my own class and RPG. > Yesterday I decided to see if I could make RPGLE and Java work > together with an example from the Internet. > https://www/. > mysamplecode.com%2F2011%2F06%2Fcall-java-from-rpgle-explanation-with.h > tml&data=05%7C02%7Cbill.blalock%40fisglobal.com%7C1ab34eb773e942c6b917 > 08dce62ca4f6%7Ce3ff91d834c84b15a0b418910a6ac575%7C0%7C0%7C638638326638 > 161185%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ > BTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=RhVyxWqlc9RIuMdwMnnEQYv > D5nYdge7P5rYz7jhbKSw%3D&reserved=0 > This is a well thought out example. > > I wanted to eliminate coding errors in my RPGLE and Java, to minimize > the possibility that this is a signature error. Still getting the same error. > > I created an Eclipse project, rpgExample. I copied the Java source > from the example into two files, Item.java and GetItem.java. In > Eclipse I exported them to the IFS as a jar file, named > rpgExample.jar. The destination was /iasp1/java/prcExample. So now I > have the jar in /iasp1/java/prcExample/rpgExample.jar. > > I create the RPGLE program as BLALOCK/QRPGLESRC (PRCPWDIRG). I > changed the package name from "com.as400samplecode" to match my > package name of "rpgExample" in both Java and RPGLE. > > I used this statement at the top of the RPGLE program: > cmdString = 'ADDENVVAR ENVVAR(CLASSPATH) ' + > 'VALUE(''/iasp1/java/prcExample/rpgExample.jar'')' + > 'REPLACE(*YES)'; > runCmd(cmdString); > > I checked the value of CLASSPATH after executing the program with > WRKENVVAR. The value was > CLASSPATH > '/java/prcExample/rpgExample.jar' > That is what I expected. I checked the CLASSPATH with WRKLNK. It was > found. > > The execution fails with the RNX0301 error. > > I cannot understand what is going on. I'd appreciate some advice. I > can send the source code to you. > > Thanks > > > > > > > Bill Blalock > Complete Payment Recovery Services > C (205) 292-0725 > E [email protected]<mailto:[email protected]> > > The information contained in this message is proprietary and/or > confidential. If you are not the intended recipient, please: (i) > delete the message and all copies; (ii) do not disclose, distribute or > use the message in any manner; and (iii) notify the sender > immediately. In addition, please be aware that any message addressed > to our domain is subject to archiving and review by persons other than > the intended recipient. Thank you. Message Encrypted via TLS > connection > -- > This is the Java Programming on and around the IBM i (JAVA400-L) > mailing list To post a message email: [email protected] To > subscribe, unsubscribe, or change list options, > visit: > https://list/ > s.midrange.com%2Fmailman%2Flistinfo%2Fjava400-l&data=05%7C02%7Cbill.bl > alock%40fisglobal.com%7C1ab34eb773e942c6b91708dce62ca4f6%7Ce3ff91d834c > 84b15a0b418910a6ac575%7C0%7C0%7C638638326638172248%7CUnknown%7CTWFpbGZ > sb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 > D%7C0%7C%7C%7C&sdata=yxYnwZe%2BB1ubtfZU3fEi1AdT7QQ8qVgGDC0Nek8fqpE%3D& > reserved=0 or email: [email protected] > Before posting, please take a moment to review the archives at > https://archive.midrange.com/java400-l. > -- This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/java400-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/java400-l. The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. Message Encrypted via TLS connection -- This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/java400-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/java400-l. The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. Message Encrypted via TLS connection -- This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/java400-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/java400-l.