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



That's because the JNI FindClass method under the covers returns
NoClassDefFoundError when it can't find the class. This is a different
mechanism than that used when using Class.forName() or one of the techniques
that causes the ClassNotFoundException.

Gary

-----Original Message-----
From: java400-l-bounces+garyp=firstech.com@xxxxxxxxxxxx
[mailto:java400-l-bounces+garyp=firstech.com@xxxxxxxxxxxx] On Behalf Of
Barbara Morris
Sent: Thursday, November 08, 2007 10:37 AM
To: java400-l@xxxxxxxxxxxx
Subject: Re: Java class not found but it's in the default path?

Joe Sam Shirah wrote:

I'm not familiar with Scott Klement's JDBC driver, and I'm a
little
confused by the implication that his (or any custom) driver is in
jt400.jar.
Regardless, the thing to note is that you are getting a No
*ClassDef*
Found error, not a ClassNotFoundException.

The javadocs for NoClassDefFoundError say: "The searched-for
class
definition existed when the currently executing
class was compiled, but the definition can no longer be found. "
I'll refer
you to:
...

Joe Sam, that's interesting. I didn't realize there were two
exceptions
associated with class-not-found. (I don't know whether I would have
noticed if I ever got a ClassNotFound instead of a NoClassDefFound.)

I think Scott's code uses JNI to make native method calls to an
existing
JDBC driver; I have only ever seen NoClassDefFound when a class is not
found for a native method call. I'm just guessing - maybe the class
loader used by JNI for native method calls goes through the same path
as
for method calls in compiled Java classes, so it gives NoClassDefFound.

For example, when I call the following RPG program, which tries to call
method mth() in class NoSuchClass, the call fails with
java.lang.NoClassDefFoundError: NoSuchClass.

D meth pr
extproc(*java:'NoSuchClass':'mth')
D static
/free
mth();
return;

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

This thread ...

Replies:

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.