复制到 IFS 时,Java 源中的标点符号更改为重音字母
我正在尝试运行一个使用 java 方法的 RPGLE 程序。我正在通过 FTP 将 java 代码(xxxx.java 文件)从我的系统(Windows XP)传输到 AS/400 IFS 目录。将其传输到IFS后,文件CCSID显示为819。
我在QSH中编译.java文件,没有显示错误。但是会生成两个class文件。 IE Mailer.java
→ Mailer.class
和 Mailer$1.class
但是当我调用我的 RPGLE 程序时,显示了一个 java 异常...
Java exception received when calling Java method (C G D F)...
Application error. RNX0301 unmonitored by MAILERDEMO at statement 000000500
当我按选项 5 在 IFS 中看到 Mailer.java
文件时,出现 {
、 }
、 [
等符号、]
、!
、/
、\
等改为其他一些符号。
所以请建议我一些解决方案,以便我可以运行这个程序。如何将.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...
I am trying to run a RPGLE program which use java methods. I am transfering the java code (xxxx.java file) from my system(Windows XP) to the AS/400 IFS directory through FTP. After transfering it to IFS, the file CCSID is shown as 819.
I am compiling the .java file in QSH, no error is shown. But two class files are generated. i.e.Mailer.java
→ Mailer.class
and Mailer$1.class
But when I am calling my RPGLE program, a java exception is shown...
Java exception received when calling Java method (C G D F)...
Application error. RNX0301 unmonitored by MAILERDEMO at statement 000000500
When I saw the Mailer.java
file in IFS by pressing option 5, symbols like {
, }
, [
, ]
, !
, /
, \
etc. are changed to some other symbols.
So plz suggest me some solutions for this, so that I can run this program. How to transfer the .java file to IFS without changing the characters to some different ones?
Here are some details.....
System CCSID Value - 819
Job CCSID - 273
My Java source code in IFS directory:
// 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();
ü
Java Exception shown running RPGLE program:
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您可以在 QSH 中使用 javac 编译源代码,那么 Java 源代码本身将以 javac 可接受的方式传输(它不进行代码页转换,并期望读取的字节为 819)。 Mailer$1.class 来自 Mailer 中的一个匿名类(一个新的 FooBar(),后面带有一个 {} 块)。
它对您来说看起来不正确,然后我希望是因为 AS/400 系统很可能与您的 5250 模拟器在使用的字符集上不一致,而且我不会担心(只要 javac 工作)。
然而,您的错误消息表明,描述您要调用的 Java 方法的 RPG 标头与实际存在的方法不匹配。对我来说,您似乎想调用“demo.Mailer.sendSimpleMail(String, String, String, String)”,它应该返回一个字符串,但您没有这样的方法。
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.
IMO 根本没有理由在 iSeries 上编译代码...开发、测试和&在工作站上构建代码...然后部署和部署在主机上测试应用程序 jar。
IMO there's no reason at all to compile code on the iSeries ... develop, test, & build the code on a workstation ... then deploy & test the application jar on the host.