|
This sounds familiar. Is /QIBM/ProdData/OS400/Java400/ in the Java extensions directory? I can't remember. If so, then classes loaded from there can't see classes in the classpath (because they are loaded by a class loader that's only looking at the extensions directory). So your JDBCPopulate class is in the extensions directory and the jt400.jar isn't, so JDBCPopulate can't load classes from jt400.jar. It took me about 3 days to figure out what was going on when that happened to me. Pretty much cured me of the lazy habit of throwing jars into the extensions directory to avoid explicitly naming them in the classpath. (Although that isn't exactly what happened here.) Moral of the story in this case would be to put your source code and compiled classes in your own directories and not in IBM's. PC2 -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Pete Helgren Sent: February 13, 2007 14:12 To: Java Programming on and around the iSeries / AS400 Subject: Re: RUNJVA problems Mike, I have been able to replicate this and I am equally stumped. I grabbed and example from http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzahh/exples5.htm and created a .java source member. I used QSH and changed to the directory I copied the source to (/QIBM/ProdData/OS400/Java400/ just to keep it simple) I used javac in QSH to compile and it complained about not finding package: "JDBCPopulate.java:54: package com.ibm.as400.access does not exist DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());" So I added a classpath parameter to the compile: javac -classpath '/QIBM/ProdData/Http/Public/jt400/lib/jt400.jar:.' JDBCPopulate.java That allowed it to compile just fine. Running it however with the following command string generates the error: java -classpath '/QIBM/ProdData/Http/Public/jt400/lib/jt400.jar:.' JDBCPopulate VAS400 PeteTemp Test java.lang.NoClassDefFoundError: com/ibm/as400/access/AS400JDBCDriver at java.lang.Throwable.<init>(Throwable.java:195) at java.lang.Error.<init>(Error.java:49) at java.lang.NoClassDefFoundError.<init>(NoClassDefFoundError.java:40 ) at JDBCPopulate.main(JDBCPopulate.java:54) $ Interesting that the same classpath parameter allows it to compile but doesn't allow it to run. Since it is a runtime error, I wonder if there is a compatibility issue or an error being thrown that I am not seeing. I JUST put on the latest cume and Java group for V5R3M0 (13). I wonder what the issue is? This should be pretty straight forward. I'll keep playing. Pete
As an Amazon Associate we earn from qualifying purchases.
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.