[tcljava-user] regarding java objects
Brought to you by:
mdejong
From: Mrinal K. <mr...@gm...> - 2007-05-24 05:33:10
|
Hi, I have a web application which runs expect scripts on remote machines using tclBlend. Now i want to use the same thing to push java objects into the data base this is how i invoke the jtclsh shell from my web application Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("cmd /c C:\\TclBlend\\bin\\jtclsh.exe C:\\ScriptFiles\\script"+ ""+ID + ConstantsFile.SCRIPT_FILE_EXTENSION); and the contents of the script file that i am using is given below #!C:\TclBlend\bin\jtclsh -- package require java package require Expect set session null spawn telnet afads 23 set something [java::new chars.rulewizard.GenerateFactObject "mrinal123"] puts $something and the "GenerateFactObject" class is just a dummy class i want to instantiate for testing /** * * @author Baba */ public class GenerateFactObject { public static FactObject fact; /** Creates a new instance of GenerateFactObject */ public GenerateFactObject(String strName) { System.out.println("working = " + strName); } } now when i try to run that script it gives me "unknown class "GenerateFactObject"" i know there can be a problem with the classpath but i changed it but the error doesnt go. the next thing i tried is that i copied the GenerateFactObject.class file into the C:\TclBlend\bin dir(where jtclsh is present) Again when i tried running (java::new GeneratFactObject "Mrinal") ,it still gives me the same error (unknown class "GenerateFactObject"). In short, if I want to instantiate custom java objects , what should be location for there class files? can anyone please guide me on this. Regards, Mrinal |