|
We are having trouble resolving to the LogManager Class in the
java/util/logging/ package when attempting to access it through an RPG
interface.
When we run a similar program in QSHELL it works.
Our Java programmer knows next to nothing about the iSeries and I have
an adequate, but limited knowledge of Java. In the RPG I have the
following test code:
d newTest PR O EXTPROC(*JAVA
d :'au.com.eigansvar.-
d web.webservices.userdb.client.-
d TestLogManager'
d : *CONSTRUCTOR)
d CLASS(*JAVA
d :'au.com.eigansvar.-
d web.webservices.userdb.client.-
d TestLogManager')
*
d testIt PR O EXTPROC(*JAVA
d :'au.com.eigansvar.-
d web.webservices.userdb.client.-
d TestLogManager'
d : 'testIt')
d CLASS( *JAVA : 'java.lang.String')
d testObj S O CLASS(*JAVA
:'au.com.eigansvar.-
web.webservices.userdb.client.-
TestLogManager')
d getName S like(jstring)
c eval testObj= newTest()
c eval getname= testIt(testObj)
The program fails on the last line with:
Message . . . . : Java exception received when calling Java method.
Cause . . . . . : RPG procedure JAVTST07 in program ANVDEV/JAVTST07
received
Java exception "java.lang.NoClassDefFoundError:
java/util/logging/LogManager" when calling method "testIt" with
signature
"()Ljava.lang.String;" in class
"au.com.eigansvar.web.webservices.userdb.client.TestLogManager".
Recovery . . . : Contact the person responsible for program
maintenance to
determine the cause of the problem.
Technical description . . . . . . . . : If the exception indicates
that the
Java class was not found, ensure the class for the method is in the
class
path. If the exception indicates that the Java method was not found,
check
the method name and signature. If the signature is not correct, change
the
The java class is as follows:
package au.com.eigansvar.web.webservices.userdb.client;
import java.util.logging.LogManager;
public class TestLogManager {
public static void main(String[] args) {
System.out.println("Testing if LogManager class exists in the
system");
LogManager logManager = LogManager.getLogManager();
if (logManager == null) {
System.out.println("It's null");
} else {
System.out.println("It's there");
}
}
public String testIt() {
LogManager logManager = LogManager.getLogManager();
if (logManager == null) {
return "It's null";
} else {
return "It's there";
}
}
}
In the QSHELL we ran the following:
cd /java/leo
$
java -cp . au.com.eigansvar.web.webservices.userdb.client.TestLogManager
Testing if LogManager class exists in the system
It's there
$
The Java programmer thought that the JVM may be using an earlier JDK
however as far as I can tell, both the JVM and QSHELL are running the
same JDK. I found this with the following iSeries command:
JAVA *VERSION
Version JVM V5R3M0 JDK 1.4.2.
And in QSHELL:
java -version
java version "1.4.2"
$
Any obvious errors I've made, or hints to help me solve this will of
course be greatly appreciated.
This work is creating an interface to the Active Directory to enable us
to retrieve employee details for e-mailing of reports to the user's
e-mail address.
*********************************************************************************************************
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
you are not the intended recipient, any use, disclosure or copying of this
message is unauthorised. If you have received this message in error, please
reply using the sender's email address.
This footnote confirms that this email message has been scanned for computer
viruses. EIG-Ansvar Limited does not accept liability for any loss or damage,
whether caused by our own negligence or not, that results from a computer virus
or defect in the transmission of this email or any attached file.
EIG-Ansvar Limited - Australia (A.B.N. 21 007 216 506)
Email : insure@xxxxxxxxxxxxxxxx
Eig-Ansvar Limited - New Zealand
Email : insure@xxxxxxxxxxxxxxxx
*********************************************************************************************************
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.