× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I get the same error message with Web jobs getting using java to access
another server. To solve the program, everytime the program starts... I
issue the following command.

ADDENVVAR ENVVAR(CLASSPATH) VALUE('.:/javaapps:/javaapps/jtds-1.2.jar')
REPLACE(*YES)

I'd like to know if there's another method to solve the issue though.

Michael Schutte
Admin Professional
Bob Evans Bob-B-Q: You haven't had barbeque until you've had Bob Evans
Bob-B-Q. Try our six Bob-B-Q dishes, starting at $5.99. For more
information, visit www.BobEvans.com.


rpg400-l-bounces@xxxxxxxxxxxx wrote on 07/16/2008 02:12:24 PM:

Greetings List,
I am looking at using Aaron Bartell's RPGMAIL for sending email from our
i5 and am getting some strange results.

I have taken his example program and modified it to send a test email to
myself. If I run my program I get the following error:

Message ID . . . . . . : RNX0301 Severity . . . . . . . : 50

Message type . . . . . : Escape

Date sent . . . . . . : 07/16/08 Time sent . . . . . . :
11:12:53


Message . . . . : Java exception received when calling Java method.

Cause . . . . . : RPG procedure RPGMAIL_NE in program
RPGMAIL/RPGMAILSV
received Java exception "java.lang.NoClassDefFoundError:

com/mowyourlawn/rpgmail/RPGMail" when calling method "<init>" with
signature
"()V" in class "com.mowyourlawn.rpgmail.RPGMail".


If I sign off, then sign back on and run his example program then run my
program, everything works.

I have gone line by line between the two program and can see no
differences other than mine uses variables in creating the subject,
email address and the path to the attachment.

Has anyone ever seen something like this before?


Below is a copy of my code:

**********************************************************************
* SET COMPILER OPTIONS
**********************************************************************
H dftactgrp(*no) thread(*serialize) bnddir('RPGMAIL')
/copy qsource,RPGMailCp
/copy qsource,ErrorCp
**********************************************************************
* PROGRAM NAME: VCM00073RM
* CREATED BY: TERRENCE L. ANDERSON
* CREATION DATE: 07/14/08
* PURPOSE OF PROGRAM: EMAIL EXCEL SPREADSHEET OF VCM COST BY
* CUSTOMER.
*
* THIS PROGRAM USES THE FREE EMAIL UTILITY RPGMAIL BY AARON BARTELL
*
* INSTRUCTIONS ON HOW TO USE IT CAN BE FOUND AT:
* http://www.mowyourlawn.com/RPGMail.html
*
**********************************************************************

**********************************************************************
* ENTRY PARMS.
**********************************************************************
D ENTRYPARMS PR ExtPgm('VCM00073R')
D FROMCUSTC 16
D THRUCUSTC 16
D BOOKPATH 256

D ENTRYPARMS PI
D FROMCUSTC 16
D THRUCUSTC 16
D BOOKPATH 256
**********************************************************************
* EXTERNAL DATA AREA FOR EMAIL NAME AND ADDRESS
**********************************************************************
D DS
D EMAIL_NAME_AND_ADDRESS...
D 1 95 DTAARA(VCM0007DTA)
D EMNAME 1 35
D EMADDRESS 36 95
**********************************************************************
* FIELD DEFINITIONS.
**********************************************************************
D DIV S 3A INZ(*BLANKS)
D X S 4 0 INZ(0)
D FROMCUST# S 15 5 INZ(0)
D THRUCUST# S 15 5 INZ(0)

D email s o class(*java: RPGMail)
D error ds likeds(Error_Info)
**********************************************************************
* DATE FIELD DEFINITIONS.
**********************************************************************
D FROMMDY S D DATFMT(*MDY)
D THRUMDY S D DATFMT(*MDY)




// ******************************************************************
// * START FREE FORM CALCS.
// ******************************************************************

/FREE

// ******************************************************************
// * CONVERT CUSTOMER NUMBERS TO NUMERIC.
// ******************************************************************

FROMCUST# = %DEC(FROMCUSTC : 15 : 5);
THRUCUST# = %DEC(THRUCUSTC : 15 : 5);

// ******************************************************************
// * GET EMAIL INFORMATION.
// ******************************************************************

IN EMAIL_NAME_AND_ADDRESS;
UNLOCK EMAIL_NAME_AND_ADDRESS;

// ******************************************************************
// * SET JAVA ENVIRONMENT.
// ******************************************************************

monitor;

RPGMail_init();

on-error;

error = Error_catch();

endmon;

monitor;

// ******************************************************************
// * INSTANTIATE THE JAVA OBJECT IN TO THE VARIABLE CALLED EMAIL.
// ******************************************************************

email = RPGMail_new();

// ******************************************************************
// * SET THE "FROM" ADDRESS.
// ******************************************************************

RPGMail_addAddress(email: 'FROM': 'noreply@xxxxxxxxxxxx': ' ');

// ******************************************************************
// * SET THE "TO" ADDRESS.
// ******************************************************************

RPGMail_addAddress(email: 'TO': %TRIM(EMADDRESS) : ' ');

// ******************************************************************
// * CREATE THE SUBJECT LINE.
// ******************************************************************

RPGMail_setSubject(email: 'VCM COST BY CUSTOMER BY PART FROM ' +
'CUSTOMER NUMBER ' + %CHAR(FROMCUST#) + ' TO CUSTOMER NUMBER ' +
%CHAR(THRUCUST#));

// ******************************************************************
// * ATTACH THE FILE TO THE EMAIL.
// ******************************************************************

RPGMail_addFileAttachment(
email: %trim(bookpath) : ' ' : 'application/xls');

// ******************************************************************
// * POINT TO THE MS EXCHANGE SERVER.
// ******************************************************************

RPGMail_setSMTPHost(email: 'xxx.xxx.xxx.xxx');

// ******************************************************************
// * SET THE PORT TO BE USED.
// ******************************************************************

RPGMail_setSMTPPort(email: '25');

// ******************************************************************
// * SEND THE EMAIL.
// ******************************************************************

RPGMail_send(email);

// ******************************************************************
// * CATCH ANY ERRORS THAT OCCUR.
// ******************************************************************

on-error;

error = Error_catch();

endmon;

*INLR = *ON;
RETURN;

/END-FREE



Terry Anderson
Programming Manager
Citation Corporation
Switchboard 1.251.867.5481 ext 212
Direct Line 1.251.809.2312
Fax 251.867.0525
Cell 1.251.363.4975



--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.