× 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.



 Barbara,

        I follow your statement to log the java system.out statement result.
I found something which need you verify for me.

1. I specify the stderr.txt and stdout.txt in my SystemDefaults.properties,
these two files not exist in this moment.
2. Signoff and signon.
3. ADDENVVAR ENVVAR(QIBM_USE_DESCRIPTOR_STDIO) VALUE(Y)
    ADDENVVAR ENVVAR('CLASSPATH') VALUE(',:/GENMAC')
4. When I ran my RPG pgm(which call java method), the RPG program normal end
and these two stdxxx  file not autocreated.
5. When I ran the java program from Qshell console, java pgm normal end and
system autocreate these two stdxxx file, and java program write those
System.out.println statement output to stdout.txt. I ran java program again
in Qshell console, same output to stdout.txt. But the output content
replaced, not appended to stdout.txt. 

6. I ran the RPG(call java) pgm, it's normal end and result output to
stdout.txt and replaced, not appended.

7. I ran another RPG(call java will got error for test), the error output to
stderr.txt and detail java error output appended to stdout.txt.

So my question is:

1. Does RPG(call java method) pgm don't auto create stdxxx file ? But Qshell
did.
2.  How do I set the stdout.txt as appended mode not replaced mode ?

Best regards,

Vengoal


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Barbara Morris
Sent: Wednesday, September 03, 2003 8:00 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Rpg calls Java with errors

Adele Cavalli wrote:
> 
> >From RPG I'm trying to call a java method. Probabibly
> something gooes wrong because I see some messages sent by VM but they 
> disappear immediately and I get the error RNX0301 
> java.lang.InstantiationException . . .
> 
> Is there a way to read these messages before they disappear ?
> 

Adele, the only way I know to see them is to get them sent to a file.

1. In your home directory, create a file called SystemDefaults.properties.  
   You can also put this file in /QIBM/UserData/Java400 - that way it 
   will affect every job that doesn't have this file in its home directory.
2. In the file, add the following lines (putting whatever files you 
   want - they don't have to be in your home directory).  I don't 
   know if the lines have to start in column 1, but they do in my file.
      os400.stdout=file:/home/mydir/stdout.txt
      os400.stderr=file:/home/mydir/stderr.txt
3. You may also have to do 
     ===> ADDENVVAR ENVVAR(QIBM_USE_DESCRIPTOR_STDIO) VALUE(Y)
   before doing any RPG->Java calls.
4. Run your RPG program, and when it's finished, do
     ===> wrklnk '/home/mydir/std*' or whatever files you used
   and then display the files.

You'll probably have to sign off and back on before it takes affect.

_______________________________________________
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 ...

Follow-Ups:

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.