2

我正在尝试运行一个使用 java 方法的 RPGLE 程序。我正在通过 FTP 将 java 代码(xxxx.java 文件)从我的系统(Windows XP)传输到 AS/400 IFS 目录。将其传输到 IFS 后,文件 CCSID 显示为 819。

我在 QSH 中编译 .java 文件,没有显示错误。但是会生成两个类文件。即 Mailer.javaMailer.classMailer$1.class

但是当我调用我的 RPGLE 程序时,会显示一个 java 异常......

Java exception received when calling Java method (C G D F)... 
Application error.  RNX0301 unmonitored by MAILERDEMO at statement 000000500

Mailer.java当我通过按选项 5 在 IFS 中看到该文件时,像{, }, [, ], !,/\符号将更改为其他一些符号。

所以请给我一些解决方案,这样我就可以运行这个程序。如何在不将字符更改为不同字符的情况下将 .java 文件传输到 IFS?

这里有一些细节......

系统 CCSID 值 - 819

工作 CCSID - 273

我在 IFS 目录中的 Java 源代码:

// Load Properties File                                                        
if (is |= null) ä                                                              
    try ä                                                                      
        properties = new Properties();                                         
        properties.load(is);                                                   
    ü                                                                          
    catch (Exception e) ä                                                      
        System.err.println("Error " + "Ö"" + e.getLocalizedMessage()           
            + "Ö"" + " loading AS/400 Connection Properties.");                
        throw new RuntimeException(e);                                         
    ü                                                                          
ü                                                                              

// Assume properties passed as system properties                               
else ä                                                                         
    properties = System.getProperties();                                       
ü                                                                              

显示运行 RPGLE 程序的 Java 异常:

Message ID . . . . . . :   RNQ0301       Severity . . . . . . . :   99         
Message type . . . . . :   Inquiry                                             
Date sent  . . . . . . :   12/30/10      Time sent  . . . . . . :   11:31:57   

Message . . . . :   Java exception received when calling Java method (C G D    
  F).                                                                          
Cause . . . . . :   RPG procedure MAILERDEMO in program SAHOON1/MAILERDEMO     
  received Java exception "java.lang.NoSuchMethodError: sendSimpleMail" when   
  calling method "sendSimpleMail" with signature                               
  "(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;)L 
  java.lang.String;" in class "demo.Mailer".                                   
Recovery  . . . :   Contact the person responsible for program maintenance to  
  determine the cause of the problem.                                          
Possible choices for replying to message . . . . . . . . . . . . . . . :       
  D -- Obtain RPG formatted dump.                                              
                                                                       More... 
4

2 回答 2

3

If you can compile your source with javac in QSH then the Java source code itself was transferred in a way that made it acceptable to javac (which doesn't do code page conversion and expects the bytes read to be in 819). The Mailer$1.class comes from an anonymous class in Mailer (a new FooBar() with a {}-block afterwards).

That it looks incorrect to you, I would then expect to be because the AS/400 system is most likely not agreeing with your 5250 emulator on the character sets used, and I wouldn't worry (as long as javac works).

Your error message indicates however, that there is a mismatch between the RPG header describing what Java method you want to call, and the one which is actually there. To me it looks like you want to invoke "demo.Mailer.sendSimpleMail(String, String, String, String)" which should return a String, and you don't have such a method.

于 2010-12-30T13:31:24.460 回答
1

IMO 根本没有理由在 iSeries 上编译代码……在工作站上开发、测试和构建代码……然后在主机上部署和测试应用程序 jar。

于 2010-12-30T15:24:07.323 回答