forName() is a static method. Don't forget the keyword "static" in the
prototype.
ClassName.class is "class literal" according to the java spec. You
probably can't prototype it and RPG may not support it.
instance.getClass() will return the same thing if you have an instance.
I'm really wondering how iOS and RPG are going to handle the
PersistenceContext that is implied here. Let us know how it goes.
You may be having trouble finding the class because persistence context
is usually provided by the containter object. In this case, you have no
container (Websphere or Tomcat). Supposedly you can have an application
managed context, but I've not seen it done.
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Chris Beck
Sent: Monday, August 24, 2009 12:59 PM
To: java400-l@xxxxxxxxxxxx
Subject: Re: Help calling java from RPG
I just started playing with that but I just get a
ClassNotFoundException. I did some googling on that and there are a
number of people that have not been able to get that to work from RPG.
bmorris@xxxxxxxxxx 8/24/2009 12:20:48 PM >>>
Chris Beck wrote:
Hello,
I am creating a RPG program that calls multiple Java method from RPG
and am having problems with one of them. In the code snippet below I am
wondering how to set the hxplvl6Class field to the propper value? in
Java I would just use the following: "Hxplvl6 hxplvl6 =
em.find(Hxplvl6.class, l6number);"
...
D hxplvl6Class S O CLASS(*JAVA :
'java.lang.Class' )
/Free
HxpLvl6 = find(em:hxplvl6Class:l6Number)
Chris, just a guess ... maybe the forName() method in java.lang.Class
would work.
hxplvl6Class = forname('HxpLvl6');
--
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/java400-l.
This email transmission and any documents, files or previous email
messages attached to it may contain information that is confidential or
legally privileged. If you are not the intended recipient, you are
hereby notified that any disclosure, copying, printing, distributing or
use of this transmission is strictly prohibited. If you have received
this transmission in error, please immediately notify the sender by
telephone or return email and delete the original transmission and its
attachments without reading or saving in any manner.
The Evangelical Lutheran Good Samaritan Society.
--
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.