Re: [tcljava-user] Class not found after successful class import.
Brought to you by:
mdejong
From: <PFi...@hb...> - 2005-11-17 06:40:29
|
I can get around this problem by putting the appropriate jar file on the system class path. But it;s strange that the "java::import" finds " EmbeddedDriver" but the "java::call" fails unless the class is on the system class path. The tcl classpath is set as follows. lappend x C:\\IBM\\Cloudscape_10.1\\lib\\derby.jar lappend x C:\\IBM\\Cloudscape_10.1\\lib\\derbyclient.jar lappend x C:\\IBM\\Cloudscape_10.1\\lib\\derbynet.jar lappend x C:\\IBM\\Cloudscape_10.1\\lib\\derbytools.jar set env(TCL_CLASSPATH) $x I tried various forward and back slash combinations. None of then worked. I also tried modifying the classpath variable within the script but that did not work either. set CLASSPATHList [ split [ lindex [ array get env CLASSPATH ] 1 ] ";" ] lappend CLASSPATHList $x set env(CLASSPATH) $CLASSPATHList puts "\nNew CLASSPATH is...............\n" foreach i [ split [ lindex [ array get env CLASSPATH ] 1 ] ";" ] { puts [ format "%-5s %-50s" " " $i ] } Has anyone else had issues like this on Windows XP. I really don't want to have to put all the required jar files on the system class path. Regards. PATRICK FINNEGAN. WebSphere Consultant. HBF Web Master LDAP Administrator. <PFi...@hb...> Sent by: tcl...@li... 17/11/2005 12:42 PM Please respond to tcl...@li... To <tcl...@li...> cc Subject [tcljava-user] Class not found after successful class import. The following code is executed inside a proc. The "EmbeddedDriver" class is imported successfully but attempts to call it generate a class not found error. # import required classes java::import org.apache.derby.jdbc.EmbeddedDriver java::import org.apache.derby.drda.NetworkServerControl java::import org.apache.derby.jdbc.ClientDriver java::import java.sql.Connection java::import java.sql.DriverManager java::import java.sql.ResultSet java::import java.sql.SQLWarning java::import java.sql.Statement java::import java.sql.ResultSetMetaData puts "\nimported classes are:\n" foreach i [java::import] { puts [ format "%-5s %-50s" " " $i ] } This generates ==> imported classes are: org.apache.derby.drda.NetworkServerControl java.sql.DriverManager org.apache.derby.jdbc.ClientDriver java.sql.ResultSetMetaData java.sql.Statement org.apache.derby.jdbc.EmbeddedDriver java.sql.ResultSet java.sql.Connection java.sql.SQLWarning The JAVA call fails. java::call Class forName org.apache.derby.jdbc.EmbeddedDriver *** Stack trace is: java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver at java.net.URLClassLoader.findClass(URLClassLoader.java:375) at java.lang.ClassLoader.loadClass(ClassLoader.java:562) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:442) at java.lang.ClassLoader.loadClass(ClassLoader.java:494) at java.lang.Class.forName1(Native Method) at java.lang.Class.forName(Class.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:85) ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ tcljava-user mailing list tcl...@li... https://lists.sourceforge.net/lists/listinfo/tcljava-user =================================================== HBF Health Funds Inc. a registered organisation under the National Health Act HBF Insurance Pty Ltd ACN 009 268 277 This email is a confidential communication intended only for the named Addressee(s). If you are not that person any disclosure, copying, distribution or use of this email or the information in it is prohibited. Please notify us immediately by telephone, (+61) 08 9265 6111 or return email and delete this email. The views in this email may be personal to the author and not those of HBF. |